How to create an authinfo.gpg encrypted file with a GitHub token

Juergen Christoffel jc.gnupg18a at
Wed Feb 26 14:20:11 CET 2020

On Wed, Feb 26, 2020 at 12:18:00AM +0000, John Stevenson wrote:
>I would like to store a GitHub personal access token in a file called
>~/.authinfo.gpg so that the token is not stored unencrypted on my
>computer.  This file would be used by Emacs to talk to GitHub via its API.

Recent versions of Emacs (>= 23.x) offer EasyPG ("epa-mode") which handles
GnuPG encrypted files easily. That might be a good place to start looking
for what you might need. Just try to create /tmp/foo.gpg and save it. You
should be asked for a recipient and/or a key.

Or, if you're using org-mode, you could handle encrypted data there as it
offers to encrypt/decrypt certain regions of .org files:

Cheers, JC

  If universal surveillance were the answer, lots of us would have moved to the
  former East Germany. If surveillance cameras were the answer, camera-happy London,
  with something like 500,000 of them at a cost of $700 million, would be the safest
  city on the planet. -- Bruce Schneier

More information about the Gnupg-users mailing list