-
This takes the user input into text1 converts it into a numeric code and encrypts the text in another form, but if you try and make it use hello i get an overflow error, hel works ok. Help, please;
Private Sub CmdOK_Click()
If Text1.Text = "" Then Exit Sub
AlphaKey = Text1.Text
finalkey = ""
thelastchar = Len(AlphaKey)
For i = 1 To thelastchar
theletter = Mid(AlphaKey, i, 1)
finalkey = finalkey & Asc(theletter)
Next i
Open "pass.log" For Output As #1
thelastchar = Len(FrmPasswords.Text1.Text)
For i = 1 To thelastchar
theletter = Mid(FrmPasswords.Text1.Text, i, 1)
Print #1, Asc(theletter) Xor finalkey; <<<<<<- Here
Next i
Close #1
SaveSetting "passpro", "Encryption", "codeno", finalkey
SaveSetting "Passpro", "Encryption", "Cryptvalue", "2"
Open "pass.log" For Input As #1
FrmPasswords.Text1.Text = Input(LOF(1), 1)
Close #1
Unload frmKey
End Sub
thanks:-)
-
I am not sure how this works but try this.
Replace this line.
Print #1, Asc(theletter) Xor finalkey; <<<<<<- Here
With this line:
Print #1, Asc(theletter) Xor Left(finalkey, 9)
I have not used Xor before and I am not overly sure what it is supposed to return..I thought true or false. My deduction was that the right side was too large and by bring
it down in size it should work...this works but I am not sure if it is what you are looking for..
Worth a shot...