Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using System.Security.Cryptography
Message
From
16/11/2003 16:34:25
 
 
To
16/11/2003 16:09:53
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00850467
Message ID:
00850492
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform