Re: Differences on output between OpenSSL and CryptoTool

2013-10-31 Thread shathawa
> Hello, > > I'm trying to compare the results of the openssl tool with the cryptool > 1.4.31 > > + Filename topsecret.txt which only contains the character 'a' > + Encrypt it with DES using CBC mode with key and iv = 0 produces the > result '32ea a0fa 4f77 fb92' > > user@debian:~$ xxd topsecret.tx

RE: Differences on output between OpenSSL and CryptoTool

2013-10-29 Thread Dave Thompson
>From: owner-openssl-users On Behalf Of Luis Rocha >Sent: Monday, October 28, 2013 18:48 >I'm trying to compare the results of the openssl tool with the cryptool 1.4.31 >+ Filename topsecret.txt which only contains the character 'a' >+ Encrypt it with DES using CBC mode with key and iv = 0 produc

Re: Differences on output between OpenSSL and CryptoTool

2013-10-29 Thread Viktor Dukhovni
On Tue, Oct 29, 2013 at 05:26:39PM +0100, Luis Rocha wrote: > btw a interesting phenomenon where encrypting with the same key reveals the > plaintext. There are two such keys among the 4 weak DES keys: 0101010101010101 fefefefefefefefe 1f1f1f1f1f1f1f1f e0e0e0e0e0e0e0e0 http:

Re: Differences on output between OpenSSL and CryptoTool

2013-10-29 Thread Luis Rocha
Thanks guys! really learning cool stuff I will take it from here and appreciate your time. btw a interesting phenomenon where encrypting with the same key reveals the plaintext. echo -n 'deadbeef' > topsecret.txt xxd topsecret.txt 6465 6164 6265 6566 openssl enc -des-cbc -nosalt -nopad -K 0

Re: Differences on output between OpenSSL and CryptoTool

2013-10-29 Thread Viktor Dukhovni
On Tue, Oct 29, 2013 at 03:54:50PM +0100, Luis Rocha wrote: > The X.923 padding attaches to a complete message block another block of > zeros: A = 00 00 00 00 00 00 00 00 I would expect the last padding byte to be 08, not 00, since 8 padding bytes were added. PKCS#7 padding for the same complete

Re: Differences on output between OpenSSL and CryptoTool

2013-10-29 Thread andrew cooke
why not use -nopad when calling openssl enc, and add the zero padding yourself? > echo -n '' > topsecret.txt > head -c8 /dev/zero >> topsecret.txt > xxd topsecret.txt 000: 6161 6161 6161 6161 > openssl enc -des-cbc -K 0101010101010101 -

Re: Differences on output between OpenSSL and CryptoTool

2013-10-29 Thread Viktor Dukhovni
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 010101

Re: Differences on output between OpenSSL and CryptoTool

2013-10-29 Thread Luis Rocha
Ok so I read more about it and for DES a block consists of 64 bit = 16 hex characters The X.923 padding attaches to a complete message block another block of zeros: A = 00 00 00 00 00 00 00 00 so I created a text file with 64 bits (16 hex characters) $echo -n '' > topsecret.txt $xxd t

Re: Differences on output between OpenSSL and CryptoTool

2013-10-29 Thread Luis Rocha
Thank you Victor! 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 -nosalt -in topsecre

Re: Differences on output between OpenSSL and CryptoTool

2013-10-28 Thread Viktor Dukhovni
On Mon, Oct 28, 2013 at 11:48:22PM +0100, Luis Rocha wrote: > + Filename topsecret.txt which only contains the character 'a' > + Encrypt it with DES using CBC mode with key and iv = 0 produces the > result '32ea a0fa 4f77 fb92' > > user@debian:~$ openssl enc -des-cbc -K 0 -iv 0 -nosalt -in topsec

Differences on output between OpenSSL and CryptoTool

2013-10-28 Thread Luis Rocha
Hello, I'm trying to compare the results of the openssl tool with the cryptool 1.4.31 + Filename topsecret.txt which only contains the character 'a' + Encrypt it with DES using CBC mode with key and iv = 0 produces the result '32ea a0fa 4f77 fb92' user@debian:~$ xxd topsecret.txt 000: 61