{"id":57,"date":"2008-07-06T14:22:53","date_gmt":"2008-07-06T12:22:53","guid":{"rendered":"http:\/\/bergs.biz\/blog\/?p=57"},"modified":"2015-06-19T09:22:03","modified_gmt":"2015-06-19T07:22:03","slug":"gpg-with-idea-on-the-mac","status":"publish","type":"post","link":"https:\/\/bergs.biz\/blog\/2008\/07\/06\/gpg-with-idea-on-the-mac\/","title":{"rendered":"GPG with IDEA on the Mac"},"content":{"rendered":"<p>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.<\/p>\n<p>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&#8217;t decrypt the message. A quick look at EnigMail&#8217;s console window told me that the message was encrypted using <a title=\"International Data Encryption Algorithm\" href=\"http:\/\/en.wikipedia.org\/wiki\/International_Data_Encryption_Algorithm\" target=\"_blank\">IDEA<\/a>, and that the version of GPG I had installed was lacking support of that encryption algorithm.<\/p>\n<p><!--more-->So I downloaded myself the <a title=\"source code of IDEA plugin\" href=\"ftp:\/\/ftp.gnupg.dk\/pub\/contrib-dk\/idea.c.gz \">source<\/a> of the IDEA plugin, which is just a single C source file. A quick search at Google pointed me to <a href=\"http:\/\/macgpg.sourceforge.net\/en\/docs\/howto-install-IDEA.txt.asc\" target=\"_blank\">this<\/a> page on MacPGP, which unfortunately only described how to compile the module into GPG, which is not what I wanted. It&#8217;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&#8217;t have to recompile everything, but the new version willl automatically use the dynamic module I compiled erlier.<\/p>\n<p>I couldn&#8217;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:<\/p>\n<pre>gcc -dynamic -Wall -O2 -shared -fPIC -c -o idea.o idea.c\r\nlibtool -dynamic -o idea.do -lc idea.o<\/pre>\n<p>To make GPG use that module I changed <code>.gnupg\/gpg.conf<\/code> to include the following option:<\/p>\n<pre>load-extension \/usr\/local\/lib\/gnupg\/idea.do<\/pre>\n<p>I restarted Thunderbird and invoked the console again. As you can see, IDEA support is now present:<\/p>\n<pre>Supported algorithms:\r\nPubkey: RSA, RSA-E, RSA-S, ELG-E, DSA\r\nCipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH\r\nHash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224\r\nCompression: Uncompressed, ZIP, ZLIB, BZIP2<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to compile IDEA as a dynamically-loadable module for GPG on a Mac.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,27],"tags":[29,28,31],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-computers","category-mac-computers","tag-encryption","tag-gpg","tag-security"],"_links":{"self":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":1,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":873,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/57\/revisions\/873"}],"wp:attachment":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}