Making a simple text or data encryption and decryption function.
An encryption and decryption function.
An encryption and decryption function.
- Private Function Enc(eStr as string) as string
- Dim a As String, b As Integer, c As String
- c = ""
- For i=1 to len(eStr)
- a = Mid(eStr,i,1)
- b = Asc(a) XOR 123
- c = c & Chr(b)
- Next i
- Enc = c
- End Function
To Encrypt the string:
myStr = "This is a test"
myStr = Enc(myStr)
To Decrypt the string again use same function after encryption.
myStr = Enc(myStr)
No comments:
Post a Comment