I am trying to decrypt a gpg file, but am continually getting the following error:
gpg: decryption failed: Bad session key
I realised afterwards that the gpg passphrase (which is set by a script) has an exclamation in it
passphrase="my!pass"
When setting via TTY, bash complains
-bash: !pass: event not found
When I echo the variable, it's unset.
user@host:~$ echo $passphrase
user@host:~$
So, the variable is unknown, and I assume that's why I can't decrypt my file.
I've tried the following as a password:
- my!pass
- my
- !pass
- 'my!pass'
- -bash: !pass: event not found
- bash: !pass: event not found
- -bash:
- bash:
- event not found
Fairly sure I've just learned a very painful lesson here, but it's worth a shot.
Can anyone help with:
- What does bash do with an unset variable if you try to use it?
- How does a script deal with an unset variable?
- Is there anything else I can try in place of the password?
- Is there an ASCII / UTF whitespace code that I can try in place of the password?
''
) string?