Gpg decryption error

While trying to decrypt the secrets in single line command line below I was getting error.

[code]

cat file <or echo "whatever">  | base64 –decode | gpg -d

[/code]

[code]
gpg: public key decryption failed: Inappropriate ioctl for device
gpg: decryption failed: No secret key

[/code]

The reason for the key that you have used is password protected. The pipe won’t work with gpg if your key is password protected.

[code]

gpg –export "Jayesh-key" | base64 # To get your key

gpg –list-keys

[/code]

In order to get that working. Either you remove pipe in 2 commands.

[code]

echo "whatever" | base64 –decode > file.gpg

gpg -d file.gpg

[/code]

or you can modify your key to be without password by providing blank password but thats not a recommended or ideal way.

[code]

gpg –edit-key YourKey

gpg prmpt > passwd

Once it prompts enter existing password to unlock. Once done just enter for blank password.

gpg prompt > save

[/code]