Simple code to Crypt UnCrypt string using a key
Simple code to Crypt UnCrypt string using a key
Rate Simple code to Crypt UnCrypt string using a key
(1(1 Vote))
If Command1.Caption = "Crypt" Then
Command1.Caption = "UnCrypt"
Else
Command1.Caption = "Crypt"
End If
Text1.Text = CryptIt(Text1.Text, Text2.Text)
End Sub
Private Function CryptIt(ToCrypt As String, CryptString As String)
Dim PosS As Long, PosC As Long, TempString As String
TempString = Space$(Len(ToCrypt))
PosC = 1
For PosS = 1 To Len(ToCrypt)
If PosC > Len(CryptString) Then PosC = 1
Mid(TempString, PosS, 1) = Chr$(Asc(Mid(ToCrypt, PosS, 1)) Xor Asc(Mid(CryptString, PosC, 1)))
If Asc(Mid(TempString, PosS, 1)) = 0 Then Mid(TempString, PosS, 1) = Mid(ToCrypt, PosS, 1)
PosC = PosC + 1
Next PosS
CryptIt = TempString
End Function
Simple code to Crypt UnCrypt string using a key Comments
No comments yet — be the first to post one!
Post a Comment