Created
May 9, 2022 06:38
-
-
Save chnirt/32e43818a340c844938ee78b994adaa0 to your computer and use it in GitHub Desktop.
Encrypt & Descrypt by GPG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Encrypt & Decrypt with PGP by Chnirt" | |
# install gpg | |
# https://gpgtools.org/ | |
# gpg --full-generate-key | |
choice="Encrypt Decrypt Exist" | |
select option in $choice | |
do | |
echo "$option" | |
case $option in | |
Encrypt) | |
echo "Please enter the filename you want to encrypt" | |
read inputFile; | |
echo "Please enter the filename you want to generate" | |
read outputFile; | |
gpg --encrypt --output "$outputFile.gpg" --recipient [email protected] $inputFile | |
break | |
;; | |
Decrypt) | |
echo "Please enter the filename you want to encrypt" | |
read inputFile; | |
echo "Please enter the filename you want to encrypt" | |
read outputFile; | |
gpg --decrypt --output $outputFile $inputFile | |
break | |
;; | |
*) | |
break | |
;; | |
esac | |
done | |
# See more | |
# https://itsfoss.com/gpg-encrypt-files-basic/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment