Return to Snippet

Revision: 12385
at March 12, 2009 17:08 by blackf0rk

Initial Code
Public Function EncryptString(ByVal InSeed As Integer, ByVal InString As String) As String
   Dim c1 As Integer
   Dim NewEncryptString As String
   Dim EncryptSeed As Integer
   Dim EncryptChar As String

   NewEncryptString = ""
   EncryptSeed = InSeed
   For c1 = 1 To Len(InString)
      EncryptChar = Mid(InString, c1, 1)
      EncryptChar = Chr(Asc(EncryptChar) Xor EncryptSeed)
      EncryptSeed = EncryptSeed Xor c1
      NewEncryptString = NewEncryptString & EncryptChar

   EncryptString = NewEncryptString
End Function

Initial URL

Initial Description
Passing in a seed and your string will return an encrypted string. Pass in the same seed and the encrypted string again and it will return the original unencrypted string.

Initial Title
Simple String Encryption

Initial Tags

Initial Language