On Tue, 16 Apr 2002, Steven Reddie wrote: > I don't know what that command is outputting, but typically the output of > OpenSSL commands is an ASN.1 structure which may, for example, contain the > algorithm identifier, identifying which algorithm was used for encryption. > The increased size could also be a padding factor, for example padding out > to the nearest 8-byte boundary.
No. That should be an FAQ (isn't it already?). DES is a block cipher, so it can only encrypt blocks of 8 octets at a time. That's why the output length is rounded to the next 8 octets boundary. There's no DER added. In order to know the original length when decrypting, padding is introduced, and the decrypting application needs to verify the padding, and remove it. Since the decrypting application needs to verify the padding and remove it, the encrypting application *must* add some padding, even if the original text length is a multiple of 8 octets. (the decrypting application has no way to distinguish between 'no padding' and 'bad padding'). That's why the encrypted text length is *always* rounded to the next 8 octets boundary, whatever the original length is. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Jukka Alve > Sent: Monday, 15 April 2002 9:13 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Growing file size with des-ecb encryption > > > Hi All, > > I am not sure if this question made it to the list last time I sent it. > Apologies if this is a duplicate. > > I am wondering why the file size grows by 8 bytes when doing > > openssl des-ecb -nosalt -in infile -out outfile -K $Key -iv 0 -p > > What is in those 8 extra bytes? Is this a bug or a feature? > > Best regards, > > Jukka Alve -- Erwann ABALEA <[EMAIL PROTECTED]> - RSA PGP Key ID: 0x2D0EABD5 ----- Je viens d'adopter une limace (elle s'appele "Chompie"), et j'ai trouve des infos sur un site qui n'a pas ete mis a jour depuis des siecles! Meme si l'auteur ne s'y interesse plus, le site garde tout son interet. -+- P in : Guide du Neuneu d'Usenet - L'ęre des limaces média -+- ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]