/ Published in: VB.NET
URL: http://codefinds.blogspot.com/2009/01/simple-string-encryption.html
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.
Expand |
Embed | Plain Text
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 Next EncryptString = NewEncryptString End Function
You need to login to post a comment.
