all groups > c# > february 2004 >
You're in the

c#

group:

CryptoStream question


Re: CryptoStream question Rob Teixeira [MVP]
2/7/2004 6:26:05 PM
c#:
How did you store the values?

-Rob Teixeira [MVP]

[quoted text, click to view]

CryptoStream question Fede
2/7/2004 10:30:32 PM
I have a file that contains initialization vector and key crypted with the
key 'passwd'. My problem is that when I execute the code

TripleDESCryptoServiceProvider pk = new TripleDESCryptoServiceProvider();
FileStream fin = new
FileStream("iv_key_cry.txt",FileMode.Open,FileAccess.Read);
CryptoStream encStream = new CryptoStream(fin,
passwd.CreateDecryptor(passwd.Key,passwd.IV),
CryptoStreamMode.Read);
encStream.Read(pk.IV,0,pk.IV.Length);
encStream.Read(pk.Key,0,pk.Key.Length);

pk.IV and pk.Key contain random values instead the iv-key I stored. Where is
my mistake?

Re: CryptoStream question DalePres
2/7/2004 11:19:49 PM
Your sample code doesn't show you creating any object named passwd. The
only items in your sample that would have a Key and IV property would be pk.
If you're trying to use the string "passwd" you have missed the entire
concept.

Where does the object passwd come from and what type is it?

Dale

[quoted text, click to view]

AddThis Social Bookmark Button