transparent encryption with crypt++, gpg and xemacs-21.4.15 ?
Adrian Aichner
adrian at xemacs.org
Sat Mar 13 15:01:03 EST 2004
The following message is a courtesy copy of an article
that has been posted to comp.emacs.xemacs as well.
>>>>> "Manfred" == Manfred Bartz <spamhere at dev.null> writes:
Manfred> crypt++ just ignores me!
Manfred> I have added this to my init.el file:
Manfred> (setq crypt-encryption-type 'gpg
Manfred> crypt-encryption-file-extension "\\(\\.e\\)$"
Manfred> crypt-bind-insert-file nil
Manfred> crypt-freeze-vs-fortran nil)
Manfred> (require 'crypt)
Manfred> crypt.el is a symlink to crypt++.el
Manfred> I don't get any passphrase prompt when saving a file with the ".e"
Manfred> extension, it just saves the file without error message.
Manfred> When I change the 'gpg to 'pgp crypt++ asks for a passphrase but
Manfred> then it cannot find pgp (because I use gpg).
Manfred, Karl, xemacs-beta,
I just debugged in the area today.
Part of my problem was that sample.init.el sheipped with XEmacs (which
I load in site-start.el) loads crypt.el, which I have not symlinked to
crypt++.el.
Secondly, at least in native Windows crypt++ destroys file content on
decryption due to use of
(let ((coding-system-for-write 'no-conversion)
(coding-system-for-read 'no-conversion)
in
(defun crypt-encrypt-region (start end key &optional decrypt)
I changed the above to
(let ((coding-system-for-write 'binary)
(coding-system-for-read 'binary)
My .emacs bit currently looks as follows:
;;; APA:
;;; crypt is already loaded by sample.init.el, therefor we have to
;;; force loading crypt++ and rebuild the tables here!
(setq crypt-encryption-type 'gpg
crypt-encryption-file-extension nil
crypt-bind-insert-file nil
crypt-freeze-vs-fortran nil)
(load "crypt++")
(crypt-rebuild-tables)
(crypt-bind-insert-file)
(modify-coding-system-alist 'file "\\.gpg$" 'binary)
(modify-coding-system-alist 'process "gpg" 'binary)
And things are now in working order, except for following warning,
which even gets written into the encrypted file itself!
gpg: WARNING: message was not integrity protected
Karl, am I making sense?
Best regards,
Adrian
Manfred> The parameters in the crypt-build-encryption-alist for gpg look
Manfred> reasonable AFAICS.
Manfred> If anyone has this working, could you please post your init.el
Manfred> settings?
Manfred> Or maybe I should use another method or package?
Manfred> --
Manfred> Manfred
--
Adrian Aichner
mailto:adrian at xemacs.org
http://www.xemacs.org/
More information about the XEmacs-Beta
mailing list