On Tue, Jun 15, 1999 at 01:22:29PM +0200, Erwann ABALEA wrote:
> Something strange happens when I try to encrypt some data using the
> 'openssl enc' tool... [...] always 1 block larger... (or course, if
> I start with a 7 bytes file, I end with an 8 bytes file, that's
> normal). Is the padding mandatory, [...]
Yes. The padding standard that is followed is that if you have to pad
by one byte, this byte is set to 1; if you have to add two bytes, both
are 2; ...; if you have to add 8 bytes, all of them are set to 8.
This means that after decryption, you can see where the file really
ends. Padding with 0 zero-bytes if the original length is a multiple
of the block-size does not work, because the original file may end
in 0x01, or 0x02 0x02, or 0x03 0x03, etc.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]