Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with key size in encryption
Message
De
11/05/2006 16:37:06
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Problem with key size in encryption
Divers
Thread ID:
01121144
Message ID:
01121144
Vues:
167
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform