>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