Re: CryptoStream error
From: Samuel Caparros (monroe_at_ciudadparagon.com)
Date: 20 Jan 2005 08:49:20 -0800
Ok, found it. Just in case someone ever needs to know about this issue,
my conclusions after dealing with my own silly mistakes are;
1.- While decrypting, RC2 crashes if it finds one single byte more or
less than you encrypted. Be very, very careful about array sizes. Make
sure to declare them with the appropiate number of elements, up to the
last byte. Even better if you can handle them dinamically.
2.- The RC2 algorithm needs an *8* byte initialization vector. Not 4,
not "any power of 4", not anything (this was corrupting my data). 8.
3.- Sometimes you need a fresh RSA key pair. Just in case.