gao
gao

Reputation: 1

Openssl ecb decryption comamnd got 'bad decrypt'

I am trying to use the OpenSSL 1.0.2p to do the encryption/decryption with ECB. The command like: openssl enc -aes-256-ecb -e -in abc -out abc_en -k 1122334455

This works fine, but when I try to decrypt like: openssl enc -aes-256-ecb -d -in abc_en -out abc_1 -k 1122334455 and got: bad decrypt 3080656072:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:531:

I don't know why the decryption does not work. Can anyone help me with this? Thanks in advance.

Upvotes: 0

Views: 40

Answers (1)

gao
gao

Reputation: 1

I use the -K to replace -k, then it works now. like: openssl enc -aes-256-ecb -e -in abc -out abc_en -K 1122334455 openssl enc -aes-256-ecb -d -in abc_en -out abc_1 -K 1122334455

Upvotes: 0

Related Questions