<div dir="ltr"><div>Not working yet:</div><div><br></div>$ openssl enc -aes-256-cbc -d -md md5 -nopad -iter 10000 -in hello.en -out <a href="http://hello.de">hello.de</a> -k garystest<br><div>$ more hello.en<br>Salted__z▒▒0><br>▒       K▒▒>▒▒▒<br></div><div>$ openssl enc -aes-256-cbc -d -md md5 -in hello.en -out <a href="http://hello.de">hello.de</a> -k garystest<br>*** WARNING : deprecated key derivation used.<br>Using -iter or -pbkdf2 would be better.<br></div><div>$ more hello.en<br>Salted__z▒▒0><br>▒       K▒▒>▒▒▒<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 3, 2023 at 10:33 AM Tomas Mraz <<a href="mailto:tomas@openssl.org">tomas@openssl.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm sorry for confusing you. Here is the command to use:<br>
<br>
openssl enc -aes-256-cbc -d -md md5 -in hello.en -out hello -k garystest<br>
<br>
Tomas Mraz, OpenSSL<br>
<br>
On Mon, 2023-04-03 at 10:17 -0700, Gary Li wrote:<br>
> Tomas,<br>
> Thank you for the suggestion, it still is not working for me. Here<br>
> are my steps (you might see what I did wrong):<br>
> <br>
> Encrypt:<br>
> $ more hello<br>
> Hello World!<br>
> $ openssl version -a<br>
> OpenSSL 1.0.2k-fips  26 Jan 2017<br>
> built on: reproducible build, date unspecified<br>
> platform: linux-x86_64<br>
> options:  bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int)<br>
> idea(int) blowfish(idx)<br>
> compiler: gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DZLIB -<br>
> DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -<br>
> m64 -DL_ENDIAN -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -<br>
> fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -<br>
> grecord-gcc-switches   -m64 -mtune=generic -Wa,--noexecstack -DPURIFY<br>
> -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -<br>
> DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -<br>
> DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -<br>
> DGHASH_ASM -DECP_NISTZ256_ASM<br>
> OPENSSLDIR: "/etc/pki/tls"<br>
> engines:  rdrand dynamic<br>
> $ openssl enc -aes-256-cbc -in hello -out hello.en -k garystest<br>
> <br>
> Decrypt:<br>
> $ openssl version -a<br>
> OpenSSL 1.1.1t  7 Feb 2023<br>
> built on: Thu Mar 30 22:02:29 2023 UTC<br>
> platform: linux-x86_64<br>
> options:  bn(64,64) rc4(16x,int) des(int) idea(int) blowfish(ptr)<br>
> compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -<br>
> DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -<br>
> DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -<br>
> DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -<br>
> DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -<br>
> DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG<br>
> OPENSSLDIR: "/usr/local/ssl/ssl"<br>
> ENGINESDIR: "/usr/local/ssl/lib/engines-1.1"<br>
> Seeding source: os-specific<br>
> $ openssl enc -aes-256-cbc -d -md sha256 -in hello.en -out <a href="http://hello.de" rel="noreferrer" target="_blank">hello.de</a> -<br>
> k garystest<br>
> *** WARNING : deprecated key derivation used.<br>
> Using -iter or -pbkdf2 would be better.<br>
> bad decrypt<br>
> 139817593476416:error:06065064:digital envelope<br>
> routines:EVP_DecryptFinal_ex:bad decrypt:crypto/evp/evp_enc.c:612:<br>
> $ openssl enc -aes-256-cbc -d -md sha256 -nopad -in hello.en -out<br>
> <a href="http://hello.de" rel="noreferrer" target="_blank">hello.de</a> -k garystest<br>
> *** WARNING : deprecated key derivation used.<br>
> Using -iter or -pbkdf2 would be better.<br>
> more hello.en<br>
> Salted__z▒▒0><br>
> ▒       K▒▒>▒▒▒<br>
> $ openssl enc -aes-256-cbc -d -md sha256 -nopad -iter 10000 -in<br>
> hello.en -out <a href="http://hello.de" rel="noreferrer" target="_blank">hello.de</a> -k garystest<br>
> $ more hello.en<br>
> Salted__z▒▒0><br>
> ▒       K▒▒>▒▒▒<br>
> <br>
> On Mon, Apr 3, 2023 at 8:44 AM Tomas Mraz <<a href="mailto:tomas@openssl.org" target="_blank">tomas@openssl.org</a>> wrote:<br>
> > As written in the openssl-enc manual page the default digest for<br>
> > hashing the password was changed from MD5 to SHA256 in OpenSSL-<br>
> > 1.1.0.<br>
> > <br>
> > You need to use -md sha256 option with the enc tool on 1.1.1 to<br>
> > decrypt<br>
> > files from the 1.0.2 version.<br>
> > <br>
> > Tomas Mraz, OpenSSL<br>
> > <br>
> > On Mon, 2023-04-03 at 07:03 -0700, Gary Li wrote:<br>
> > > Yes, with Openssl enc tool to decrypt on Ubuntu 20.04, encrypted<br>
> > > on<br>
> > > CentOS 7.<br>
> > > <br>
> > > On Sun, Apr 2, 2023, 11:11 PM Tomas Mraz <<a href="mailto:tomas@openssl.org" target="_blank">tomas@openssl.org</a>><br>
> > > wrote:<br>
> > > > Hello,<br>
> > > > <br>
> > > > is that with the openssl enc tool? Or something else?<br>
> > > > <br>
> > > > Tomas Mraz, OpenSSL<br>
> > > > <br>
> > > > On Fri, 2023-03-31 at 16:27 -0700, Gary Li wrote:<br>
> > > > > HI there,<br>
> > > > > I have files in products that are generated by Openssl<br>
> > > > > 1.0.2k-<br>
> > > > > fips,<br>
> > > > > but my new development system under Ubuntu 20.04 does not<br>
> > > > > support<br>
> > > > > this old version, and I cannot decrypt these files with<br>
> > > > > version<br>
> > > > > OpenSSL 1.1.1f or 1.1.1t.<br>
> > > > > Decryption did not have warning or error messages but the<br>
> > > > > contents<br>
> > > > > were wrong.<br>
> > > > > Are there any known solutions to this issue?<br>
> > > > > <br>
> > > > > Thank you in advance,<br>
> > > > > <br>
> > > > > Gary<br>
> > > > <br>
> > <br>
<br>
-- <br>
Tomáš Mráz, OpenSSL<br>
<br>
</blockquote></div>