<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; GnuPG</title> <atom:link href="http://www.ghacks.net/tag/gnupg/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Fri, 10 Feb 2012 16:53:42 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Recursively encrypt directories with gpgdir</title><link>http://www.ghacks.net/2009/06/03/recursively-encrypt-directories-with-gpgdir/</link> <comments>http://www.ghacks.net/2009/06/03/recursively-encrypt-directories-with-gpgdir/#comments</comments> <pubDate>Tue, 02 Jun 2009 23:11:25 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[decryption]]></category> <category><![CDATA[encryption]]></category> <category><![CDATA[GnuPG]]></category> <category><![CDATA[gpg]]></category> <guid
isPermaLink="false">http://www.ghacks.net/2009/06/03/recursively-encrypt-directories-with-gpgdir/</guid> <description><![CDATA[Recently I wrote an article about Encrypting and decrypting files with GnuPG. This article described how to encrypt single files in with the help of gpg. But what happens if you have a directory full of files? Sure you can tar the directory up and encrypt the files  as a single file. But that isn&#8217;t [...]]]></description> <content:encoded><![CDATA[<p>Recently I wrote an article about <a
title="File encryption with gpg" href="http://www.ghacks.net/2009/05/30/linux-tips-encrypting-and-decrypting-files-from-command-line-with-gpg/" target="_blank">Encrypting and decrypting files with GnuPG</a>. This article described how to encrypt single files in with the help of gpg. But what happens if you have a directory full of files? Sure you can tar the directory up and encrypt the files  as a single file. But that isn&#8217;t very practical when you don&#8217;t want to have to tar and untar a directory all the time. And what if you only want to encrypt certain files within a directory? That is when you need the help of another application.</p><p>The application you need is <a
title="gpgdir" href="http://www.cipherdyne.org/gpgdir/" target="_blank">gpgdir</a>. The gpgdir application allows you to recursively encrypt and decrypt directories on your Linux system. It&#8217;s an easy to use command line tool that can save you a lot of time when you have to do a lot of encryption of files. In this article you will see how to install gpgdir and use it for basic directory encryption/decryption.</p><p><span
id="more-13249"></span><strong>Getting and installing</strong></p><p>The only drawback is that gpgdir is not installed on your distribution by default, it doesn&#8217;t come with GnuPG, nor is it included in your repositories. You are going to have to install manually.</p><p>If you use an rpm-based distribution you can download the rpm from <a
title="gpgdir download" href="http://www.cipherdyne.org/gpgdir/download/" target="_blank">gpgdir&#8217;s download page</a>. Once you have that file downloaded you will issue the command:</p><p><em>rpm -ivh gpgdir-XXX.rpm</em></p><p>Where XXX is the release number.</p><p>If you are not using an rpm-based distribution you will have to install from source. This is actually quite easy. First download the <a
title="gpgdir source file" href="http://www.cipherdyne.org/gpgdir/download/gpgdir-1.9.4.tar.bz2" target="_blank">source file</a>. Once you have that file on your hard drive (let&#8217;s say it&#8217;s in <strong>~/Downloads/firefox/</strong>) issue the following comands:</p><p><em>cd ~/Downloads/firefox</em></p><p><em>bunzip2 gpgdir-XXX.tar.bz2</em></p><p><em>tar -xvf gpgdir-XXX.tar</em></p><p><em>cd gpgdir-XXX</em></p><p><em>./install.pl</em> (or <em>sudo ./install.pl</em>)</p><p>Where XXX is the release number.</p><p>You should now have a working installation of gpgdir.</p><p><strong>Using gpgdir</strong></p><p>Before you actually run gpgdir you have to have a gpg key generated (The article mentioned at the beginning will describe to you how this is done.) With your gpg key in mind you have to edit a single line in a file before you begin using gpgdir. The file is <em>~/.gpgdirrc. </em>What you need to do is add your gpg key user name in this file. The line you need to add looks like:</p><p>use_key USERNAME</p><p>Where USERNAME is your gpg key username (not your Linux system username &#8211; although they could be the same). If you&#8217;re not sure what your gpg key user name is issue the command:</p><p><em>gpg &#8211;list-keys</em></p><p>to see the user names of your keys.</p><p>Once you have your configuration file edited you are ready to go.</p><p>The basic usage of gpgdir is:</p><p>gpgdir -e|-d DIRECTORY OPTIONS</p><p>Let&#8217;s create a test directory containing two files. So issue the following commands to create your test environment:</p><p><em>mkdir TEST</em></p><p><em>echo $USER &gt; TEST/user</em></p><p><em>data &gt; TEST/data</em></p><p>Now you are ready to see how this works. Let&#8217;s encrypt the files in our TEST directory.</p><p><em>gpgdir -e TEST</em></p><p>You will be prompted to enter the key&#8217;s passphrase. Once you do this you will see something like:</p><p><code>[+] Encrypting files in directory: /home/jlwallen/TEST<br
/> [+] Building file list...<br
/> [+] Encrypting:  /home/jlwallen/TEST/user<br
/> [+] Encrypting:  /home/jlwallen/TEST/date<br
/> [+] Total number of files encrypted: 2</code></p><p>If you look in the TEST directory you will now see the following:</p><p>date.gpg</p><p>user.gpg</p><p>To unencrypt these files issue the following command:</p><p>gpgdir -d TEST</p><p>You will be prompted for the password again. After gpgdir decrypts the files they will no longer be encrypted.</p><p><strong>Excluding files</strong></p><p>Say you want to encrypt all files in the TEST directory but the <strong>user</strong> file. To do this you would issue the command:</p><p><em>gpgdir -e TEST &#8211;Exclude user</em></p><p>All files in TEST, except <em>user</em>, will now be encrypted.</p><p><strong>Final thoughts</strong></p><p>Although you can do more with gpgdir, you now have the fundamental usage of the command.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/06/03/recursively-encrypt-directories-with-gpgdir/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
