6
$\begingroup$

In this question on StackOverflow https://stackoverflow.com/questions/31248777/can-pkcs5padding-be-in-aes-gcm-mode it's said that GCM doesn't require a padding: why?

$\endgroup$
9
$\begingroup$

TL;DR: Padding is part of the specification of the mode and thus doesn't need to be done by the user of the primitive.


Internally GCM really is CTR mode along with a polynomial hashing function applied on the ciphertext. CTR-mode doesn't need padding because you can just partly use the bits the last counter block generated and the polynomial hash does use (zero-)padding.

For the details, see Wikipedia.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.