Encrypt and Decrypt - Simple VB6

Public Function Encrypt(Name As String, Key As Long) As String
Dim v As Long, c1 As String, z As String
For v = 1 To Len(Name)
c1 = Asc(Mid(Name, v, 1))
c1 = Chr(c1 + Key) ' private key here !
z = z & c1
Next v
Encrypt = z
End Function

Public Function Decrypt(Name As String, Key As Long) As String
Dim v As Long, c1 As String, z As String
For v = 1 To Len(Name)
c1 = Asc(Mid(Name, v, 1))
c1 = Chr(c1 - Key) ' private key here !
z = z & c1
Next v
Decrypt = z
End Function

Comments

Popular posts from this blog

வெற்றி தரும் அரிய மந்திரம்

மஹாவராஹி மந்திரம்

சொர்ண ஆகர்ஷண பைரவரின் மந்திரங்கள்