Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using System.Security.Cryptography
Message
De
16/11/2003 16:09:53
 
 
À
16/11/2003 15:38:49
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00850467
Message ID:
00850491
Vues:
18
Here is the basic idea (pun intended *g*):
dim rawKeyBytes() as Byte = System.Text.Encoding.UTF8.GetBytes(tcKey)
dim sha as new SHA1CryptoServiceProvider()
dim hash() as Byte = sha.ComputeHash(rawKeyBytes)
This will give you 20 bytes of key material in the hash byte array (or 16 if you use MD5) and you can simply extract the leftmost 8 for use with DES. I am not familiar with VB.NET so I don't know what the proper way would be of slicing 8 bytes out of the array (although .NET's Array.Copy() should work).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform