Expand|Select|Wrap|Line Numbers
- Dim x As Int64
- Dim y As Int64
- Dim z As Int64
- Dim chrpos As Int64
- Dim chrcode As Int64
- Dim str As String
- Dim Buffstr As String
- Buffstr = ""
- str = TBX1.Text
- For z = 0 To 10
- Buffstr = ""
- For x = 0 To str.Length - 1
- For y = -32768 To 65535
- If str.Chars(x) = ChrW(y) Then
- chrcode = y
- chrpos = x
- End If
- Next
- chrcode = chrcode + ((chrpos * chrpos))
- While chrcode > 65535
- chrcode -= 65535
- End While
- While chrcode <= -32768
- chrcode += 32768
- End While
- Buffstr = Buffstr & ChrW(chrcode)
- Next
- str = Buffstr
- Next
- tbx2.Text = str
> tbx1 and 2 are textboxes for input/output
> the difference between the encryption and decryption code is that the decryption is the addition the square of the position of the characters and the encryption is the subraction of the sqaure of the position of the characters
>when I run the code above and encrypt 195 1's then decrypt the output it rerurns
11111111111111111111111111111111111111111111111111 11111111111111111111111111112222222222222222222222 22222222223333333333333333333333334444444444444444 44444555555555555555555666666666666666667耷77耷
the output should be 195 1's but it is as above
in advance thank you for the help