Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jasypt 1.9 : Encrypting passwords with exclamation

I am using Jasypt 1.9, and when I try to encrypt a password with exclamation it fails. It works fine without exclamation

for ex:

./encrypt.sh input="abc!abc"
-sh: !abc": event not found

Jasypt claims it is fixed here.. http://www.jasypt.org/changelogs/jasypt/ChangeLog.txt

Note:

 ./encrypt.sh input="abc\!abc" works, but decrypting produces the "abc\!abc"
like image 871
Himalay Majumdar Avatar asked Dec 27 '22 05:12

Himalay Majumdar


1 Answers

Use single quotes instead of double. With double quotes, the shell first tries to expand !abc as a history event, giving you that error. Text in single quotes is not expanded.

This is a linux shell feature, and has nothing to do with Jasypt. The shell is expanding the expression before it executes anything.

like image 122
Reinstate Monica -- notmaynard Avatar answered Jan 12 '23 10:01

Reinstate Monica -- notmaynard