Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using System.Security.Cryptography
Message
De
16/11/2003 16:34:25
 
 
À
16/11/2003 16:09:53
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00850467
Message ID:
00850492
Vues:
15
>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).

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform