Skip to content

Instantly share code, notes, and snippets.

@MatthewLymer
Last active April 14, 2020 18:11
Show Gist options
  • Save MatthewLymer/0adea2df3e900ca002b5a2bfe5b3a1ac to your computer and use it in GitHub Desktop.
Save MatthewLymer/0adea2df3e900ca002b5a2bfe5b3a1ac to your computer and use it in GitHub Desktop.
Symmetric AES256 encryption and decryption with GPG
echo "Attack at dawn!" > secret-message-original.txt
echo "MyPassword" | gpg \
--output secret-message.txt.gpg \
--passphrase-fd 0 \
--batch \
--cipher-algo AES256 \
--symmetric secret-message-original.txt
echo "MyPassword" | gpg \
--output secret-message-decrypted.txt \
--passphrase-fd 0 \
--batch \
--decrypt secret-message.txt.gpg
cat secret-message-original.txt | md5sum
cat secret-message-decrypted.txt | md5sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment