GPG with IDEA on the Mac

One of the first things I did when I got my new Mac was install Mozilla Thunderbird, the invaluable EnigMail extension, which is a very easy-to-use frontend to GNU Privacy Guard (GPG), and of course GPG itself.

All went very smoothly, and to check whether the installation was fine I tried to opened an encrypted message which I had received some days ago. Unfortunetly GPG couldn’t decrypt the message. A quick look at EnigMail’s console window told me that the message was encrypted using IDEA, and that the version of GPG I had installed was lacking support of that encryption algorithm.

So I downloaded myself the source of the IDEA plugin, which is just a single C source file. A quick search at Google pointed me to this page on MacPGP, which unfortunately only described how to compile the module into GPG, which is not what I wanted. It’s also possible to compile IDEA into a dynamically-loadable module (that GPG loads with dlopen). I prefer that method because when a new version of GPG becomes available, I don’t have to recompile everything, but the new version willl automatically use the dynamic module I compiled erlier.

I couldn’t find any instructions how to compile the source file into a dynamic module, but I had fragments of the command-line still in my mind. I quickly came up with the following which did the trick for me:

gcc -dynamic -Wall -O2 -shared -fPIC -c -o idea.o idea.c
libtool -dynamic -o idea.do -lc idea.o

To make GPG use that module I changed .gnupg/gpg.conf to include the following option:

load-extension /usr/local/lib/gnupg/idea.do

I restarted Thunderbird and invoked the console again. As you can see, IDEA support is now present:

Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Tags: , ,

2 Responses to “GPG with IDEA on the Mac”

  1. [...] – bookmarked by 3 members originally found by pielepataan on 2009-01-11 GPG with IDEA on the Mac http://bergs.biz/blog/2008/07/06/gpg-with-idea-on-the-mac/ – bookmarked by 5 members originally [...]

  2. Fatman says:

    Speaking of GPG and Enigmail, I’m trying to encrypt Nagios notifications using GPG so they can be read with Enigmail. So far I’ve got:

    echo “message” | gpg –no-use-agent –batch –encrypt –hidden-recipient me | mail -s “test” me@email.com

    … which works, but Enigmail apparently can’t decrypt it. Have you ever tried something similar?

Leave a Reply