Mailing List Archive

How to create an authinfo.gpg encrypted file with a GitHub token
Hello everyone,
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.

I have never used GnuPGP before, although I have gnupg2 installed on Ubuntu
Linux.

After many searches, I have not found any information on how to do this. I
am looking through the documentation on the https://gnupg.org/ website, but
its unclear where to start reading.

Thank you
John
Re: How to create an authinfo.gpg encrypted file with a GitHub token [ In reply to ]
* John Stevenson:

> This file would be used by Emacs to talk to GitHub via its API.

While "used by Emacs" is quite unspecific and I possibly misunderstand
your requirements, it suggests searching for "emacs gpg". Doing so
returns many hits for Easy PG, so that might be a good place to start.

-Ralph

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: How to create an authinfo.gpg encrypted file with a GitHub token [ In reply to ]
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:

https://orgmode.org/worg/org-tutorials/encrypting-files.html

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

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: How to create an authinfo.gpg encrypted file with a GitHub token [ In reply to ]
On 2020-02-26 at 00:18 +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.
>
> I have never used GnuPGP before, although I have gnupg2 installed on Ubuntu
> Linux.

Hide away GnuPG as a low-level detail and focus on "storing credentials
for use".

Take a serious look at Pass: <https://www.passwordstore.org/>
which has an Emacs integration already, at:
<https://git.zx2c4.com/password-store/tree/contrib/emacs>.

(It's been 25 years since I last seriously used Emacs so I can't comment
on that, and I don't actually use pass myself, as I independently
created the same general thing in Python at about the same time as Pass
was create, but the model definitely works since it works for me).

-Phil

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users