1

Is there a standardized padding scheme which is prefix instead of postfix and that uses random bytes except for the first byte which would be the length of the padding?

otus
  • 32,132
  • 5
  • 70
  • 165
daruma
  • 385
  • 3
  • 12

1 Answers1

2

I know of no standard like that and also doubt it exists.

It would have similar disadvantages as random padding at the end, which is no longer in use: subliminal channel, consumption of randomness which may be expensive. Additionally, it would require knowing the message length in advance, which is a practical limitation.

otus
  • 32,132
  • 5
  • 70
  • 165
  • Ok for the subliminal channel. For randomness, a CSPRNG can be used. Implemented properly, it would not require knowing the message length in advance but maybe prepend a full random block to messages which are composed of only full blocks. – daruma Oct 14 '15 at 08:11
  • @UnixJunkie, even a CSPRNG takes time to generate randomness, compared to deterministic padding which takes a few cycles to verify. Regarding message length, unless you know it (modulo block size) you do not know how the block boundaries will fall, so you can't start encrypting. – otus Oct 14 '15 at 09:27