Skip to main content
1 of 3
eckes
  • 1k
  • 9
  • 21

Padding is used to fill up plaintext to the blocklength of the cipher. This is not needed for counter mode, since it has no blocks and can encrypt any length.

In SSH you can add padding longer than to the end of the block (I.e. To the next block or even more). This helps to make it impossible for attackers to guess the actual plaintext length. Especially for command/response sessions a lot can be learned if the cipher leaks the length. This is called traffic analysis and random padding length somewhat helps against it.

eckes
  • 1k
  • 9
  • 21