Added: Nov 21, 2001
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo
Encrypts a text string.
Highlight all by clicking in box
'add this into a form with 3 Textboxes and a Command Button
'Text1 is the message to encypt/decrypt
'Text2 is the "1" or anything else (tells whetehrt o encrypt or not)
'Text3 is the result
Private Sub Command1_Click()
Dim iSeed As Integer
Dim keyTxt, messageTxt, decrypt, directionTxt As String
keyText = "dog"
messageTxt = Text1.Text
directionTxt = Text2.Text
iSeed = 0
For i = 1 To Len(keyTxt)
iSeed = iSeed + Asc(Mid(keyTxt, i, 1))
decrypt = ""
For i = 1 To Len(messageTxt)
If (directionTxt = "1") Then
decrypt = decrypt & Chr((Asc(Mid(messageTxt, i, 1)) + (Int(Rnd() * 10))))
decrypt = decrypt & Chr((Asc(Mid(messageTxt, i, 1)) - (Int(Rnd() * 10))))
Text3.Text = decrypt
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.