skarra / ASynK

Flexible Bi-directional sync for Emacs BBDB, Google Contacts, MS Outlook, MS Exchange, CardDAV
http://asynk.io
132 stars 33 forks source link

Better password protection #24

Open jedbrown opened 11 years ago

jedbrown commented 11 years ago

The password field currently displays the password in clear text. I see a couple mentions of getpass, but it seems there is more than one code path to enter a password. A better system is to support running a process to return the password, as in gpg -d mypass.gpg, or even just .netrc.

skarra commented 11 years ago

I just pushed https://github.com/skarra/ASynK/commit/41963ad3208948ead7c7a6bb02f68973cfe20176 Have a look at the commit comments to see how to use this. Let me know what you think.

unhammer commented 11 years ago

+1 on .netrc.gpg, however, if you want to "lazily" include _all_methods, just let the user define a hook like offlineimap does (grep remotepasseval http://docs.offlineimap.org/en/latest/MANUAL.html).

With offlineimap, I have a function get_password(host,port) that decrypts my .netrc.gpg and fetches my user/password (via emacsclient, because I somehow found that easier). Before I switched to .netrc.gpg, I used the python keyring module with kwallet, again via the remotepasseval hook.

unhammer commented 11 years ago

My current method for using ~/.netrc.gpg (or, as emacs expects, ~/.authinfo.gpg): https://gist.github.com/unhammer/6158705 in case it's useful for anyone.