From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: A question on encryption Date: Thu, 28 Aug 2014 08:22:30 +0800 Message-ID: <8738chzcmx.fsf@ericabrahamsen.net> References: <20140827212724.7d0065e0@aga-netbook> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1409185131 26234 80.91.229.3 (28 Aug 2014 00:18:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Aug 2014 00:18:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 28 02:18:44 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XMnQK-0002mJ-ET for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Aug 2014 02:18:44 +0200 Original-Received: from localhost ([::1]:33765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMnQJ-00054L-LW for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Aug 2014 20:18:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMnQ3-00053M-Ng for help-gnu-emacs@gnu.org; Wed, 27 Aug 2014 20:18:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMnPw-0007ss-Vq for help-gnu-emacs@gnu.org; Wed, 27 Aug 2014 20:18:27 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:60770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMnPw-0007rp-Pm for help-gnu-emacs@gnu.org; Wed, 27 Aug 2014 20:18:20 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XMnPp-0002NJ-Vg for help-gnu-emacs@gnu.org; Thu, 28 Aug 2014 02:18:13 +0200 Original-Received: from 222.129.227.225 ([222.129.227.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Aug 2014 02:18:13 +0200 Original-Received: from eric by 222.129.227.225 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Aug 2014 02:18:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 222.129.227.225 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:YbaE0XKD2/91FegVLf5EJyoFDCg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99446 Archived-At: Marcin Borkowski writes: [...] > I created a test file (call it "test") with a single line of text and > did two things: > > 1. C-x C-f test RET, C-x C-w test.gpg RET > > Then I selected the key and hit ok. > > 2. From the command line: > gpg -e -r key-id -o test2.gpg test > > The two resulting files were different (difference in length of 3 > bytes; find-file-literally and manual inspection showed that the > beginnings were identical, but the endings were not). > > My question is: why is that so? I instrumented the function > epg-start-encrypt for Edebug, and it seems that the argument list it > constructed was identical or equivalent to the one I'm giving on the > command line. > > My other question is: is it fine? I'm an (almost) complete layman > with crypto, and I don't want to open some huge security hole because > of my ignorance. (I want to store my email passwords in encrypted > files, set a very short timeout in gpg-agent and connect it to my > mailing client, so that stealing my laptop won't enable the thief to > impersonate me.) I don't know what's going on with your specific problem, but let me recommend the "pass" command-line utility for this situation. It does just what you want -- storing passwords as gpg-encrypted files -- and if you have the agent running, that keeps all your secrets locked up nicely, without too much inconvenience. I have both SMTP and IMAP set up to fetch their passwords using an invocation of pass, and it works great. If your goal is to learn the EPG library, then ignore this! Eric