From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sascha Wilde Newsgroups: gmane.emacs.devel Subject: pgg symmetric encryption patch (was: new version of allout.el - patch and ChangeLog) Date: Mon, 3 Oct 2005 21:25:03 +0200 Message-ID: <20051003192503.GA15503@kenny.sha-bang.local> References: <2cd46e7f0509301024r71462d81v81ebd8e858f06305@mail.gmail.com> <20050930210649.GA22126@kenny.sha-bang.local> <2cd46e7f0509301452l72c262d6l89efd6fb772f61b2@mail.gmail.com> <2cd46e7f0510010928v8244052k2a98375e38fdd2ed@mail.gmail.com> <20051002104823.GA31722@kenny.sha-bang.local> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0380006963==" X-Trace: sea.gmane.org 1128368341 17156 80.91.229.2 (3 Oct 2005 19:39:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Oct 2005 19:39:01 +0000 (UTC) Cc: schwab@suse.de, ken.manheimer@gmail.com, ueno@unixuser.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 03 21:38:55 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMW87-0008Ue-6k for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 21:37:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMW86-0004iT-Il for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 15:37:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EMW47-0003D9-Q6 for emacs-devel@gnu.org; Mon, 03 Oct 2005 15:33:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EMW42-00039y-BA for emacs-devel@gnu.org; Mon, 03 Oct 2005 15:33:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMW3y-0002zc-61 for emacs-devel@gnu.org; Mon, 03 Oct 2005 15:33:28 -0400 Original-Received: from [62.141.58.119] (helo=km1136.keymachine.de) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EMVvz-0005Pl-CD; Mon, 03 Oct 2005 15:25:11 -0400 Original-Received: from kenny.sha-bang.de (xdslk130.osnanet.de [212.95.111.130]) (authenticated bits=0) by km1136.keymachine.de (8.12.11/8.12.10) with ESMTP id j93JOvZo009383; Mon, 3 Oct 2005 21:24:57 +0200 Original-Received: from wilde by kenny.sha-bang.de with local (Kenny MUA v.0409034.42) ID 1EMVvr-0004GK-Ac; Mon, 03 Oct 2005 21:25:03 +0200 Original-To: "Richard M. Stallman" Mail-Followup-To: "Richard M. Stallman" , schwab@suse.de, ken.manheimer@gmail.com, emacs-devel@gnu.org, ueno@unixuser.org In-Reply-To: User-Agent: Mutt/1.5.9i X-wieners-gbr-MailScanner-Information: MailScanner presented by www.wieners-gbr.de X-wieners-gbr-MailScanner: Nachricht wurde nicht auf Viren und Spam untersucht, sprechen Sie uns an: www.wieners-gbr.de. X-MailScanner-From: wilde@sha-bang.de X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43511 Archived-At: --===============0380006963== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 02, 2005 at 04:31:10PM -0400, Richard M. Stallman wrote: > So you would consider switching to pgg, if it would provide an > interface to symmetric encryption? >=20 > If someone wants to do it, and assuming the result is clean, it would=20 > be a good thing to do. Enclosed you'll find my preliminary patch to make symmetric encryption possible with pgg. The new function pgg-encrypt-symmetric-region asks for a passphrase and uses it to symmetrically encrypt the given region. Please note, this is by no means complete, just a small proof of concept. Ken, would something along this lines be sufficient for use with allout? cheers sascha cvs server: Diffing . Index: pgg-gpg.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/gnus/pgg-gpg.el,v retrieving revision 1.6 diff -u -r1.6 pgg-gpg.el --- pgg-gpg.el 6 Aug 2005 19:51:42 -0000 1.6 +++ pgg-gpg.el 3 Oct 2005 19:13:34 -0000 @@ -4,6 +4,7 @@ ;; 2005 Free Software Foundation, Inc. =20 ;; Author: Daiki Ueno +;; Symmetric encryption added by: Sascha Wilde ;; Created: 1999/10/28 ;; Keywords: PGP, OpenPGP, GnuPG =20 @@ -141,24 +142,32 @@ =20 (defun pgg-gpg-encrypt-region (start end recipients &optional sign) "Encrypt the current region between START and END. +If recipients is :symmetric do symmetric encryption If optional argument SIGN is non-nil, do a combined sign and encrypt." (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) + (symmetric-encryption (eq recipients :symmetric)) (passphrase - (when sign - (pgg-read-passphrase - (format "GnuPG passphrase for %s: " pgg-gpg-user-id) - pgg-gpg-user-id))) + (if symmetric-encryption + (pgg-read-passphrase + "GnuPG passphrase for symmetric encryption: ") + (when sign + (pgg-read-passphrase + (format "GnuPG passphrase for %s: " pgg-gpg-user-id) + pgg-gpg-user-id)))) (args (append - (list "--batch" "--armor" "--always-trust" "--encrypt") + (list "--batch" "--armor" "--always-trust"=20 + (if symmetric-encryption "--symmetric" "--encrypt")) (if sign (list "--sign" "--local-user" pgg-gpg-user-id)) - (if recipients - (apply #'nconc - (mapcar (lambda (rcpt) - (list pgg-gpg-recipient-argument rcpt)) - (append recipients - (if pgg-encrypt-for-me - (list pgg-gpg-user-id))))))))) + (if symmetric-encryption + nil + (if recipients + (apply #'nconc + (mapcar (lambda (rcpt) + (list pgg-gpg-recipient-argument rcpt)) + (append recipients + (if pgg-encrypt-for-me + (list pgg-gpg-user-id)))))))))) (pgg-as-lbt start end 'CRLF (pgg-gpg-process-region start end passphrase pgg-gpg-program args)) (when sign Index: pgg.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/gnus/pgg.el,v retrieving revision 1.8 diff -u -r1.8 pgg.el --- pgg.el 26 Aug 2005 00:02:05 -0000 1.8 +++ pgg.el 3 Oct 2005 19:13:34 -0000 @@ -4,6 +4,7 @@ ;; 2005 Free Software Foundation, Inc. =20 ;; Author: Daiki Ueno +;; Symmetric encryption added by: Sascha Wilde ;; Created: 1999/10/28 ;; Keywords: PGP =20 @@ -232,6 +233,18 @@ (pgg-save-coding-system start end (pgg-invoke "encrypt-region" (or pgg-scheme pgg-default-scheme) (point-min) (point-max) rcpts sign)))) + (when (interactive-p) + (pgg-display-output-buffer start end status)) + status)) + +;;;###autoload +(defun pgg-encrypt-symmetric-region (start end) + "Encrypt the current region between START and END symmetric with passphr= ase." + (interactive "r") + (let ((status + (pgg-save-coding-system start end + (pgg-invoke "encrypt-region" (or pgg-scheme pgg-default-scheme) + (point-min) (point-max) :symmetric)))) (when (interactive-p) (pgg-display-output-buffer start end status)) status)) --=20 Sascha Wilde : The most exciting phrase to hear in science, the one : that heralds new discoveries, is not "Eureka!" (I found : it!) but "That's funny ..." -- Isaac Asimov --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDQYWPchutvmkRUCQRAjhqAJ9gPXdM1GEpvePxQpUZKEXaMykGlgCgzdDh oPrATf5FcntmCc3yTUn8Oq0= =2M8l -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn-- --===============0380006963== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0380006963==--