Reputation: 23517
Does anyone know what padding scheme mysql uses for their aes_encrypt?
I've done a lot of googling, and all I found was "byte padding". But that's too general!
Thanks
Upvotes: 4
Views: 3170
Reputation: 461
This answer put me on the right track:
https://stackoverflow.com/a/19692724
So it really is PKCS7, as Marcus Adams noted as well.
Hope this helps someone.
Upvotes: 1
Reputation: 15693
If you don't know what padding is being used, then decrypt with "NoPadding". Have a look at what has been added to the end of the last block, and that will tell you what padding style is being used.
Upvotes: 1
Reputation:
Here's a good explanation with code that demonstrates how the padding works.
Upvotes: 2
Reputation: 60528
The data padding is done per RFC3369/PKCS#5. Keys are zero padded. Unfortunately, neither of these are documented, but I got the information from this bug report:
http://bugs.mysql.com/bug.php?id=16713
Upvotes: 5