[Clug-tech] OpenSLL enc AES produces 32bytes (2 blocks) with 16byte input, why?

Simon Wood simon at mungewell.org
Sun Jan 18 09:12:38 PST 2009


Gee that took a long time to deliver.....any way, I found that the answer is in the padding. 

The data must be padded with an extra 16bytes so that last byte can indicate how bytes of padding is used (in this case 16), otherwise the last byte of the data would be confused as a padding count.

If the '-nopad' option is used then you only get 1 block output for 1 block input.

Simon.

On Sat, 17 Jan 2009 12:02:31 -0700
Simon Wood <simon at mungewell.org> wrote:

> This is probably a 'feature' in the way that I am doing this but... 
> 
> Using the AES cipher with an input block of 16 bytes (128bits) causes OpenSSL enc to output 2 blocks (256bits). I thought that any block <=128 bits block could/would be output as 128bits.
> 
> Any suggestion as to why more than 1 block is output, and/or how I can ensure that only 1 block is output?
> 



More information about the clug-tech mailing list