I have a security mechanism that implements symmetric algorithm RijndaelManaged. I managed to find information what is the maximum size of encrypted data using
If you need to check this programatically, you can do so by checking the modulus. Here's some psudocode (no particular language) :
function base64Inflation (numBytes) minimumBase64Bytes = roundDown(numBytes / 3 * 4) modulus = numberOfBytes % 3 // Assuming % is the modulo operator if modulus == 0 return minimumBase64Bytes // Exact fit! No padding required. else return minimumBase64Bytes + 4 // Doesn't quite fit. We need to pad.
I've also implemented the same logic in golang:
http://play.golang.org/p/JK9XPAle5_