Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encryption function
Message
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00112039
Message ID:
00112112
Vues:
27
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform