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

Click here to load this message in the networking platform