Johannes Baeuer wrote:

> Why would a 16 byte block need to be padded by one byte to 17 bytes?

Is it really not immediately obvious?

No encrypted output for one or more bytes of input can be less than 16
bytes. Thus the smallest possible output sequence is 16-bytes. The number of
possible encrypted outputs of 16-bytes or fewer is therefore 2^(16*8).

The number of possible 15-byte plaintext inputs is 2^(15*8) and the number
of possible 16-byte plaintext inputs is 2^(16*8). Thus the number of
possible plaintext inputs of 16 bytes or fewer is greater than
2^(15*8)+2^(16*8) and thus greater than 2^(16*8).

So the number of plaintext inputs of 16 bytes or fewer is greater than the
number of ciphertext outputs of 16 bytes or fewer. Therefore, some inputs of
16 bytes of fewer must have outputs of more than 16 bytes.

DS

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to