.Net Crypto and “PKCS7 padding” errors

Posted on January 5, 2005
Filed Under /dev/null/ | 51 views |

If you’re mucking about with .Net in the System.Security.Cryptography classes and you get an error that looks like this:

Additional information: PKCS7 padding is invalid and cannot be removed.

check that your salt value is the same for your encryption and decryption processes. If it isn’t you’ll get this error.

There may be other reasons for it but that’s what it ended up being for me (and might I be so bold as to suggest being very careful when using l (el) and 1 (one) and I (capital eye) in your salt values, lest you mix them up?)

Comments

Comments are closed.