Full width home advertisement

Post Page Advertisement [Top]

Making a simple text or data encryption and decryption function.

An encryption and decryption function.
  1. Private Function Enc(eStr as string) as string
  2. Dim a As String, b As Integer, c As String
  3. c = ""
  4. For i=1 to len(eStr)
  5. a = Mid(eStr,i,1)
  6. b = Asc(a) XOR 123
  7. c = c & Chr(b)
  8. Next i
  9. Enc = c
  10. 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

Bottom Ad [Post Page]

| Designed by Colorlib