E
Eugen Feraru
Hello all,
I am trying to test the business logic of an application that uses Rindjael
encryption, by testing it when 'tampering' with the encrypted cipher.
The scenario assumes that the encrypted cipher has been tampered with (by
changing some of the values, but not removing them). I expected Rindjael
component STILL provide a decrypted cipher, other than the one originally
encrypted. By playing with the encrypted cipher and changing some of its
byte values, the algorithm sometimes works, and most of the times generates
this exception:
System.Security.Cryptography.Cryptographic : PKCS7 padding is invalid and
cannot be removed.
at
System.Security.Cryptography.RijndaelManagedTransform._DecryptData(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount, Boolean usingPKCSPadding)
at
System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(By
te[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Security.Cryptography.CryptoStream.Close()
I have been doing some research on the topic but I have not found yet an
answer.
Any help, it would be greatly appreciated.
Thanks,
Eugen
I am trying to test the business logic of an application that uses Rindjael
encryption, by testing it when 'tampering' with the encrypted cipher.
The scenario assumes that the encrypted cipher has been tampered with (by
changing some of the values, but not removing them). I expected Rindjael
component STILL provide a decrypted cipher, other than the one originally
encrypted. By playing with the encrypted cipher and changing some of its
byte values, the algorithm sometimes works, and most of the times generates
this exception:
System.Security.Cryptography.Cryptographic : PKCS7 padding is invalid and
cannot be removed.
at
System.Security.Cryptography.RijndaelManagedTransform._DecryptData(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount, Boolean usingPKCSPadding)
at
System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(By
te[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Security.Cryptography.CryptoStream.Close()
I have been doing some research on the topic but I have not found yet an
answer.
Any help, it would be greatly appreciated.
Thanks,
Eugen