I've written a script which creates an encrypted file from a plain text file using the following string:
gpg --passphrase supersecretpassword --cipher-algo AES256 --symmetric ~/password.txt
I've also written a script which decrypt the same file using the following:
gpg --batch --yes --passphrase supersecretpassword -o password.txt -d password.gpg &> /dev/null
The scripting language I used is bash!
My problem here as that I want the script to throw an error when the entered passprhase (i.e the passphrase is entered manually) is wrong.
I have no idea how I could get gpg to do the following:
if [ passphrase is wrong ]
quit the script!
continue the script!
It would be appreciated if someone who's experienced with GPG could shed some light of how do it!