This has to do with padding, which is at least 1 byte, and always ensures input + padding is an integer multiple of the block size. Hence 8 input + 1 byte minimum padding ==> 8 bytes input + 8 bytes padding.
See what happens when you feed it, for instance, 5 bytes of input: resulting file should be 8 bytes (des3 blocksize = 8) 2009/4/3 José Hidalgo C. <jhidal...@gmail.com>: > Hi: > > I'm using the openssl and EVP_EncryptInit_ex, EVP_EncryptUpdate, > EVP_EncryptFinal_ex sequence to encrypt a a short message with 3des-cbc, but > i get an strange problem. I expect if the data size is 8 bytes, the > encrypted data lenght is 8 bytes too, but i get 16 bytes. If the data size > is 16 bytes, the encrypted data length is 24 bytes. I'm sure that the data > size is 8 bytes, or 16 bytes, but i never get the expeted results, somebody > know why? > The command used in openssl: > > openssl des3 -iv 1234567812345678 -K > 0123456789ABCDEFFEDCBA98765432100123456789ABCDEF -in claro.txt -out > claro.bin > > ls -l show 8 bytes in claro.txt, and 16 bytes in claro.bin > > When i use the EVP_EncryptUpdate function, the strlen show 8 bytes in the > text message. > > Thanks. > > > -- > ------------------------------------------------------------------ > José Hidalgo C. > Ingeniero de Software > Akzio Consultores - http://www.akzio.cl > Huérfanos 669 of. 609 - Santiago > Ofi:(+56)(2)6320567 - Cel:(+56)(9)88377088 > -- Met vriendelijke groeten / Best regards, Ger Hobbelt -------------------------------------------------- web: http://www.hobbelt.com/ http://www.hebbut.net/ mail: g...@hobbelt.com mobile: +31-6-11 120 978 -------------------------------------------------- ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org