4

Why does symmetric encryption require padding? Is it to avoid the attacker to learn the size of the plaintext?

Maarten Bodewes
  • 96,351
  • 14
  • 169
  • 323
신동평
  • 75
  • 5

1 Answers1

6

Symmetric crypto does not always have padding. Stream ciphers often will not require padding. Padding is necessary when using a cipher that requires plaintexts to be a multiple of a particular size. For example, AES in CBC mode requires plaintexts that are a multiple of 128 bits. So if your plaintext is not, you must pad to make it the right size.

mikeazo
  • 39,117
  • 9
  • 118
  • 183