The below code works if "Input" is the result of a read from a binary file.
I want Input to be a literal string variable. When this is the case,
received "Length of Data to Decrypt is Invalid" error.
Any ideas appreciated.
Thank you, John.
arrResult = UTF8.GetBytes(I nput);
MemoryStream stmDecrypted = new MemoryStream();
cptTransform = tDesProvider.Cr eateDecryptor(a rrKeyBytes, arrIVBytes);
CryptoStream stmCrypt = new CryptoStream(st mDecrypted, cptTransform,
CryptoStreamMod e.Write);
stmCrypt.Write( arrResult, 0, arrResult.Lengt h);
stmCrypt.FlushF inalBlock();
stmDecrypted.Po sition = 0;
stmDecrypted.Re ad(arrResult, 0, Convert.ToInt32 (stmDecrypted.L ength));
Output = UTF8.GetString( arrResult);
I want Input to be a literal string variable. When this is the case,
received "Length of Data to Decrypt is Invalid" error.
Any ideas appreciated.
Thank you, John.
arrResult = UTF8.GetBytes(I nput);
MemoryStream stmDecrypted = new MemoryStream();
cptTransform = tDesProvider.Cr eateDecryptor(a rrKeyBytes, arrIVBytes);
CryptoStream stmCrypt = new CryptoStream(st mDecrypted, cptTransform,
CryptoStreamMod e.Write);
stmCrypt.Write( arrResult, 0, arrResult.Lengt h);
stmCrypt.FlushF inalBlock();
stmDecrypted.Po sition = 0;
stmDecrypted.Re ad(arrResult, 0, Convert.ToInt32 (stmDecrypted.L ength));
Output = UTF8.GetString( arrResult);
Comment