J'ai trouver un algorithme de cryptage en C# sur internet que j'ai passer
en VB mais là je m'y perds un peut. Donc qi quelqu'un aurais quelque minute
pour m'aider à combler mes erreurs de programmation sa serais simpa :)
Le code VB:
Private Function CryptPassword(ByVal Key As String, ByVal Password As String)
Dim HASH As Char
HASH() = ("a", ("b"), "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "_")
Dim Crypted As String
Dim PPass As Char
Dim PKey As Char
Dim APass As Integer
Dim AKey As Integer
Dim ANB As Integer
Dim ANB2 As Integer
Dim i As Integer
Crypted = "#1"
For i = 0 To Password.Length - 1
PPass = Password(i)
PKey = Key(i)
APass = CInt(PPass) / 16
AKey = CInt(PPass) Mod 16
ANB = (APass + CInt(PKey)) Mod HASH.Length
ANB2 = (AKey + CInt(PKey)) Mod HASH.Length
Crypted = HASH(ANB)
Crypted = HASH(ANB2)
Next
Return Crypted
End Function
pas de classe HASH en VB6, pas plus que de type CHAR
t'es bon pour chercher directement le code en VB6 plutôt que de convertir du C#. tu t'es juste trompé de site dans tes recherches ^^
<hr size="2" width="100%" />Prenez un instant pour répondre à [infomsg_SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp