Error in executing this command

Asked

Viewed 30 times

0

Commando:

openssl enc -aes-128-ecb -in pass -K str -iv str -nosalt -base64 -A -out $pass

Error:

non-hex Digit invalid Hex iv value

str is a hexadecimal string with 32 characters

I’m not getting through this. If you could help, that would be great!

1 answer

1

At your command the str and one of pass this one without dollar ($), therefore it is being passed as value and not as variable.

Probably the command you want is:

openssl enc -aes-128-ecb -in $pass -K $str -iv $str -nosalt -base64 -A -out $pass

However, I see other problems with the command:

  • The IV (-iv) and the key (-K) should not have the same value.
  • Do not use salt (-nosalt) is a bad idea.

These settings can dramatically decrease the security of encryption, depending on how you use it. I suggest you look at what each of these parameters do and how to handle them safely.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.