Home All Groups Group Topic Archive Search About

PasswordDeriveBytes in .NET 2.0 Beta

Author
14 May 2005 12:50 PM
christian.benien
I'm trying to run our .NET 1.1 code on the beta version of .NET 2.0.
Almost everything runs fine, however there's one small issue:

The following code is used to encrypt some data, the Key and IV are
derived with PasswordDeriveBytes. 'salt' is a byte array with length
256 (identical in both CLRs of course)

PasswordDeriveBytes kg = new PasswordDeriveBytes("test", salt);
byte[] key = kg.GetBytes(32);
byte[] iv = kg.GetBytes(16);

The key I get is identical in both CLRs (1.1.4322.2032 and
2.0.50215.44), but the second array 'iv' is different.

Does anyone know why that happens?

Thanks a lot,
Christian

Author
14 May 2005 3:58 PM
William Stacey [MVP]
I think I recall seeing on bug on this very issue.  Think it is fixed in
next beta.

--
William Stacey [MVP]

<christian.ben***@gmail.com> wrote in message
Show quoteHide quote
news:1116075027.397849.99580@g43g2000cwa.googlegroups.com...
> I'm trying to run our .NET 1.1 code on the beta version of .NET 2.0.
> Almost everything runs fine, however there's one small issue:
>
> The following code is used to encrypt some data, the Key and IV are
> derived with PasswordDeriveBytes. 'salt' is a byte array with length
> 256 (identical in both CLRs of course)
>
> PasswordDeriveBytes kg = new PasswordDeriveBytes("test", salt);
> byte[] key = kg.GetBytes(32);
> byte[] iv = kg.GetBytes(16);
>
> The key I get is identical in both CLRs (1.1.4322.2032 and
> 2.0.50215.44), but the second array 'iv' is different.
>
> Does anyone know why that happens?
>
> Thanks a lot,
> Christian
>

Bookmark and Share