Jasypt 1.9 : Encrypting passwords with exclamation

jasypt, java, password-encryption

Solution

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.

Problem

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" ```

Original source