Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with key size in encryption
Message
From
11/05/2006 18:37:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/05/2006 16:37:06
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01121144
Message ID:
01121179
Views:
14
This message has been marked as the solution to the initial question of the thread.
>I have this code to handle a key with the encryption:
>
>
>                    Dim des As DESCryptoServiceProvider = New DESCryptoServiceProvider()
>                    des.Key = bytesKey
>
>
>It fails on the des.Key line saying that the specified key is not a valid size for this algorithm.
>
>When I trace that, I obtain the following values:
>
>des.LegalKeySizes.Length=1
>des.KeySize=64
>bytesKey.Length=64
>
>So, if my bytesKey is 64 and the required KeySize is 64, why is it complaining?
>
>This only does that when I work with the Des and and RC2 algorithm. I don't have any problem when working with RijnDael and TripleDes algorithm.

Michel,
Is bytesKey a byte array (64 bytes?). KeySize is in bits ( 64 bits = 8 bytes ).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform