Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with key size in encryption
Message
From
11/05/2006 16:37:06
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Problem with key size in encryption
Miscellaneous
Thread ID:
01121144
Message ID:
01121144
Views:
161
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 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
Next
Reply
Map
View

Click here to load this message in the networking platform