Skip to content

Instantly share code, notes, and snippets.

@GrantBirki
Created July 23, 2021 23:03
Show Gist options
  • Save GrantBirki/289f67812bf24bbdf2ca7a93635b5eef to your computer and use it in GitHub Desktop.
Save GrantBirki/289f67812bf24bbdf2ca7a93635b5eef to your computer and use it in GitHub Desktop.
Encrypt a message to me using my public GPG key
curl -s https://github.com/grantbirki.gpg | gpg --import > /dev/null 2>&1; echo "<message>" | gpg -ear grantbirki@github.com
@GrantBirki
Copy link
Author

GrantBirki commented Jul 23, 2021

About

Requirements

The system you are on will need to have curl and gpg installed. Many systems have this by default.

Usage

Simply run the command in the gist above. It should work on the following systems:

  • Windows
  • Linux
  • MacOS

Output

Make sure to copy the entire output including the BEGIN/END PGP MESSAGE lines. This is the encrypted message using public key cryptography.

-----BEGIN PGP MESSAGE-----
............................
.........<message>..........
............................
-----END PGP MESSAGE-----

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