Skip to content

Instantly share code, notes, and snippets.

@epomatti
Last active January 8, 2022 22:17
Show Gist options
  • Save epomatti/c58f680b9e22b2465487cd628c6c730a to your computer and use it in GitHub Desktop.
Save epomatti/c58f680b9e22b2465487cd628c6c730a to your computer and use it in GitHub Desktop.
gpg symmetric cipher
# How to encrypt a sensitive file with symmetric cipher. (e.g. Solana keypairs)
keypair="$HOME/.config/solana/mainnet.json"
# This will create a new encrypted file "mainnet.json.gpg" on the target location
# You'll be asked to enter a passphrase
gpg -c --no-symkey-cache $keypair
# Run this command to decrypt the file using your previous passphrase
gpg -d --no-symkey-cache "$keypair.gpg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment