Created
March 30, 2021 14:09
-
-
Save andmax/a334c1606297846edbace553d73c015b to your computer and use it in GitHub Desktop.
GPG public/private keys for file encryption
This file contains hidden or 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
# First generate a public/private key pair | |
gpg --full-generate-key | |
# Export your public and private keys | |
gpg --export --armor --output <name>.gpg.pub | |
gpg --export-secret-keys <your_email> > <name>.gpg.key | |
# Import a private key on another machine | |
gpg --import <name>.gpg.key | |
# Encrypt a file name with you (your email) as recipient | |
gpg -r <your_email> --encrypt <file_name>.tgz | |
# Decrypt a file name using the password-protected key (stored in database) | |
gpg --decrypt <file_name>.tgz.gpg > <file_name>.tgz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment