Skip to content

Instantly share code, notes, and snippets.

@vpnwall-services
Last active March 27, 2024 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpnwall-services/a1be71a5965ffe0f640b986d29037100 to your computer and use it in GitHub Desktop.
Save vpnwall-services/a1be71a5965ffe0f640b986d29037100 to your computer and use it in GitHub Desktop.
[ENCRYPT DECRYPT 101] Encrypt Decrypt 101 #bash #python #encrypt #decrypt #101

ENCRYPT-DECRYPT-101

  • GPG

Make GPG read input from tty instead of GUI

export GPG_TTY=$(tty)

Encrypt

tar -cvzf - folder | gpg -c > folder.tar.gz.gpg

Decrypt

gpg -d folder.tar.gz.gpg | tar -xvzf -

Force GPG to ask for key (after first succesful decryption (its using the keychain))

echo RELOADAGENT | gpg-connect-agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment