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.