GPG AES 256 encrypt and decrypt
Encrypt
1 | gpg --cipher-algo AES256 \ |
Decrypt
1 | gpg --no-symkey-cache \ |
Option explanation
If directly using gpg -c XXX
and gpg -d XXX
the gpg-agent will prompt the password asking dialog.
See GPG manual:
1 | If this command is used with --batch, --pinentry-mode has been set to loopback, and one of |
So just set it with --batch
and --pinentry-mode loopback
, then can use the --passphrase
.
--no-symkey-cache
to disable symmetric key cached and --cipher-algo
to set algorithm.
Available algorithms can check by gpg --version
.
Hope this save your time! :)