Hello,
I'm trying to use Cryptography to encrypt/decrypt data in my application.
It was working just fine on my old computer, but now I've switched machines,
and I get the following error at Runtime.
ICryptoTransform transform = des.CreateEncryptor(desKey, desIV);
[CryptographicException: Specified initialization vector (IV) does not match
the block size for this algorithm.]
System.Security.Cryptography.TripleDESCryptoServic eProvider._NewEncryptor(By
te[] rgbKey, CipherMode mode, Byte[] rgbIV, Int32 feedbackSize,
CryptoAPITransformMode encryptMode) +1350544
System.Security.Cryptography.TripleDESCryptoServic eProvider.CreateEncryptor(
Byte[] rgbKey, Byte[] rgbIV) +41
glib.Crypto.EncryptData(Byte[] desKey, Byte[] desIV, String data) in
c:\blah\blah\blah\blah.cs:74
I'm using this to generate the key and IV Vector. :
byte[] key =
System.Text.ASCIIEncoding.ASCII.GetBytes("abcdefgh ijklm123xxxxxxxx");
//Using the same value for the IV
Thanks.