Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Encryption function
Message
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00112039
Message ID:
00112112
Views:
28
Here is another simple one- very simple one. This function will both encrypt and decrypt a string with a mask provided. A value of 0 for the mask will return the string as is.

Public Function Cipher(ByVal sData As String, ByVal nMask As Byte) As String
Dim nCount As Long, nIndex As Long
nCount = Len(sData)
For nIndex = 1 To nCount
Mid$(sData, nIndex, 1) = Chr$(Asc(Mid$(sData, nIndex, 1)) Xor nMask)
Next
Cipher = sData
End Function
SUN
Previous
Reply
Map
View

Click here to load this message in the networking platform