Take the 2-minute tour ×

If I am not mistaken, plaintext RSA is not secure. So, I have read that padding and hashing is needed to make the RSA algorithm secure. However, I am confused on what does padding or armoring mean in this context. What does RSA-padding mean, how does it work?

For instance here I have read about this, but I do not really understand the meaning behind the notion of padding. Can anyone enlighten mean about this?

share|improve this question

migrated from stackoverflow.com Jul 8 '13 at 13:08

This question came from our site for professional and enthusiast programmers.

1 Answer 1

Padding in cryptography means adding a (mostly secret) random set of data to the cryptographic functionality.

In practice and when done correctly, cryptographic padding adds a cryptographic problem and thereby reduces attack vectors because (theoretically) it reduces the success in “guessing” intermediate or final states of the encryption and/or decryption functionality.

Two notes:

  1. The reason why I wrote “when done correctly” is that one of the disadvantages of cryptographic padding is that it could make the plain text of the message susceptible to padding oracle attacks.

  2. Note that I wrote "(theoretically)" as some algorithms were weakened and even broken due to incorrect or missing implementations of cryptographic padding, but there are also ample cryptographic algorithms that can do without cryptographic padding as they use cryptographic approaches that differ from RSA's.

If you want to dive deeper into RSA-related cryptographic padding, take a look at this question and especially it's accepted answer which dives into the practice a bit more.


Note that there's also a nice and more broad description of cryptographic padding available at http://en.wikipedia.org/wiki/Padding_%28cryptography%29

share|improve this answer
"Complexity" is a bad word choice IMO, since it's usually seen as undesirable property. –  CodesInChaos Jul 8 '13 at 19:12
@CodesInChaos I see your point. Exchanged "complexity" with "a cryptographic problem", which should be more correct. –  e-sushi Jul 8 '13 at 19:15

Your Answer

