On Tue, Oct 29, 2013 at 03:18:44PM +0100, Luis Rocha wrote: > In the cryptool I'm only able to introduce the 8 bytes key and not the IV. > The documentation from CrypTool says" CBC mode is used with zero > initialization vector and X.923 padding." > > user@debian:~$ openssl enc -des-cbc -K 0101010101010101 -iv > 0000000000000000 -nosalt -in topsecret.txt | xxd > 8a08 216b 7f88 7ec4 > > In the tool (GUI) using DES CBC mode with the same key '0101010101010101' > the output is '255B DF6C 2E64 E96A' but I didnt figure out what they mean > by "zero initialization vector and X.923 padding".
OpenSSL enc(1) uses PKCS#5 (aka PKCS#7) padding: $ openssl enc -des-cbc \ -K 0101010101010101 -iv 0000000000000000 -in topsecret.txt | openssl enc -d -nopad -des-ecb -K 0101010101010101 | od -tx1 0000000 61 07 07 07 07 07 07 07 0000010 While X.923 padding makes all the padding bytes except the last zero. Mind you the claimed output '255B DF6C 2E64 E96A' does not decrypt to anything remotely resembling a padded version of "0x61", so you're still not using the CrypTool correctly as claimed: $ perl -e '($x="255BDF6C2E64E96A") =~ s/(..)/chr(hex($1))/eg; print $x;' | openssl enc -d -nopad -des-ecb -K 0101010101010101 | od -tx1 0000000 9e e5 38 5f f0 4c 06 40 0000010 -- Viktor. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org