<?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 &#187; gpg</title>
	<atom:link href="http://www.ghacks.net/tag/gpg/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Mon, 09 Nov 2009 09:34:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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>

	Tags: <a href="http://www.ghacks.net/tag/decryption/" title="decryption" rel="tag">decryption</a>, <a href="http://www.ghacks.net/tag/encryption/" title="encryption" rel="tag">encryption</a>, <a href="http://www.ghacks.net/tag/gnupg/" title="GnuPG" rel="tag">GnuPG</a>, <a href="http://www.ghacks.net/tag/gpg/" title="gpg" rel="tag">gpg</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/10/15/secure-your-files-an-introduction-to-gnupg/" title="Secure your files: An introduction to GnuPG (October 15, 2008)">Secure your files: An introduction to GnuPG</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/05/30/linux-tips-encrypting-and-decrypting-files-from-command-line-with-gpg/" title="Linux tips: Encrypting and decrypting files from command line with gpg (May 30, 2009)">Linux tips: Encrypting and decrypting files from command line with gpg</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/03/01/encrypt-thunderbird-email-with-enigmail/" title="Encrypt Thunderbird Email with Enigmail (March 1, 2009)">Encrypt Thunderbird Email with Enigmail</a> (7)</li>
	<li><a href="http://www.ghacks.net/2008/02/07/yoggie-pico-personal-mobile-security-computer/" title="Yoggie PICO Personal Mobile Security Computer (February 7, 2008)">Yoggie PICO Personal Mobile Security Computer</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/06/03/recursively-encrypt-directories-with-gpgdir/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Secure your files: An introduction to GnuPG</title>
		<link>http://www.ghacks.net/2008/10/15/secure-your-files-an-introduction-to-gnupg/</link>
		<comments>http://www.ghacks.net/2008/10/15/secure-your-files-an-introduction-to-gnupg/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 20:51:31 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[openpgp]]></category>
		<category><![CDATA[pgp]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=7650</guid>
		<description><![CDATA[GnuPG allows you to encrypt data so only the intended recipient, with a key and a password, can decrypt it. It also provides a mechanism for verifying data is from the person who has claimed to send it. GnuPG can also provide a way for you to securely prevent your files from being opened without [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gnupg.org/">GnuPG</a> allows you to encrypt data so only the intended recipient, with a key and a password, can decrypt it. It also provides a mechanism for verifying data is from the person who has claimed to send it. GnuPG can also provide a way for you to securely prevent your files from being opened without authorisation (<a href="http://en.wikipedia.org/wiki/United_States_v._Boucher">at a US border, for example</a>).</p>
<p>GnuPG, in technical terms, utilises a mixture of symmetric-key cryptography and public-key cryptography. This basically means a person generates a pair of keys; one of which is publicly shared and one is not. The publicly shared key is used to people can encrypt data for a specific person whilst the private key is used to decrypt, encrypt and sign data.</p>
<p>If you encrypt data to only be decrypted only by your private key and you carry your private key on another medium of storage, the data you encrypted will be effectively impossible to decipher.</p>
<p>To get started with GnuPG, <a href="http://www.gnupg.org/download/index.en.html">you must download GnuPG</a> which is free and open-source.</p>
<p><span id="more-7650"></span>GnuPG is available for effectively all operating systems. After you have downloaded and installed GnuPG, it might be wise to download a graphical interface because it is command line based.</p>
<p>Some GUIs focus on the management of keys, such as the generation of them and storing other people&#8217;s public keys, whilst others focus on the encrypting/decrypting.</p>
<p>WinPT is a popular Windows option. As for encrypting and decrypting, there are many choices including Enigmail for Thunderbird, FireGPG for Firefox and WinPT also provides facilities to do this.</p>
<p>With a GUI, it is fairly easy to get to grips with GnuPG. Most key managers provide wizards for the generation of keys.</p>
<p>To obtain someone&#8217;s public key, so you can send data to them securely, you could either ask them or go onto a keyserver such as pgp.mit.edu, copy their key into Notepad and then import it into your key manager.</p>
<p>It is essential to send your keys to keyservers, I would suggest pgp.mit.edu, and this can be done either through the GUI or through exporting your public key and uploading it to these sites. Once you have someone&#8217;s public key, and you are sure it belongs to them and is not a hoax, you can sign the key inside your key manager and then submit it, so people know that key is authentic.</p>
<p><strong>Key software to get started with GPG</strong></p>
<ol>
<li><a href="http://www.gnupg.org/">GnuPG</a> is absolutely necessary. <a href="ftp://ftp.gnupg.org/gcrypt/binary/gnupg-w32cli-1.4.9.exe">There is a Windows binary available.<br />
</a></li>
<li>A GUI is also necessary. For Windows users, WinPT is a safe bet.</li>
<li>If you use Thunderbird, install <a href="http://enigmail.mozdev.org/home/index.php">Enigmail</a>. If you use Firefox, install FireGPG.</li>
</ol>
<p>If you have installed GPG and would like to try it out, feel free to send me an encrypted email. My email is computerjoe (at) gmail.com and my key is on this page.</p>

	Tags: <a href="http://www.ghacks.net/tag/encryption/" title="encryption" rel="tag">encryption</a>, <a href="http://www.ghacks.net/tag/gpg/" title="gpg" rel="tag">gpg</a>, <a href="http://www.ghacks.net/tag/openpgp/" title="openpgp" rel="tag">openpgp</a>, <a href="http://www.ghacks.net/tag/pgp/" title="pgp" rel="tag">pgp</a>, <a href="http://www.ghacks.net/tag/security/" title="Security" rel="tag">Security</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/03/01/encrypt-thunderbird-email-with-enigmail/" title="Encrypt Thunderbird Email with Enigmail (March 1, 2009)">Encrypt Thunderbird Email with Enigmail</a> (7)</li>
	<li><a href="http://www.ghacks.net/2005/11/15/cryptography-tutorial/" title="Cryptography Tutorial (November 15, 2005)">Cryptography Tutorial</a> (0)</li>
	<li><a href="http://www.ghacks.net/2008/07/07/true-crypt-6-released/" title="True Crypt 6 released (July 7, 2008)">True Crypt 6 released</a> (3)</li>
	<li><a href="http://www.ghacks.net/2005/12/11/securing-your-pc-with-true-crypt/" title="Securing your Pc with True Crypt (December 11, 2005)">Securing your Pc with True Crypt</a> (27)</li>
	<li><a href="http://www.ghacks.net/2009/06/03/recursively-encrypt-directories-with-gpgdir/" title="Recursively encrypt directories with gpgdir (June 3, 2009)">Recursively encrypt directories with gpgdir</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2008/10/15/secure-your-files-an-introduction-to-gnupg/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
