Skip to content

Instantly share code, notes, and snippets.

@slavafomin
Last active May 14, 2024 10:01
Show Gist options
  • Select an option

  • Save slavafomin/7114c76a55a2d89e4119a56aa52cd484 to your computer and use it in GitHub Desktop.

Select an option

Save slavafomin/7114c76a55a2d89e4119a56aa52cd484 to your computer and use it in GitHub Desktop.
Using GPG encryption on Linux

List Keys

gpg --list-keys

Import Key

gpg --import private.key

Config file

# ~/.gnupg/gpg.conf:

default-key {KEY-ID}
default-recipient-self

Encrypt/Decrypt File

This encrypts the file using default key (default recipient):

gpg -e filename

This decrypts it back:

gpg -d filename.gpg > filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment