<?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>Brett Hutley&#039;s Blog &#187; crypto</title>
	<atom:link href="http://bretthutley.com/tag/crypto/feed/" rel="self" type="application/rss+xml" />
	<link>http://bretthutley.com</link>
	<description>Home on the Digital Range</description>
	<lastBuildDate>Mon, 23 Jan 2012 21:21:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using gpg to encrypt files on a web server</title>
		<link>http://bretthutley.com/2007/11/29/using-gpg-to-encrypt-files-on-a-web-server/</link>
		<comments>http://bretthutley.com/2007/11/29/using-gpg-to-encrypt-files-on-a-web-server/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 15:33:40 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://hutley.net/brett/2007/11/29/using-gpg-to-encrypt-files-on-a-web-server/</guid>
		<description><![CDATA[I was working on my website ValidateModel.com, and I wanted a way to protect files that are uploaded by the users. My solution is to encrypt the files with gpg when they are uploaded. Only the public key is stored on the server and the files are encrypted with this. The only way for the [...]


Related posts:<ol><li><a href='http://bretthutley.com/2009/09/04/convert-wma-files-to-mp3/' rel='bookmark' title='Converting WMA files to MP3'>Converting WMA files to MP3</a></li>
<li><a href='http://bretthutley.com/2006/01/04/using-cvs-and-ssh-under-emacs/' rel='bookmark' title='Using CVS and ssh under Emacs&#8230;'>Using CVS and ssh under Emacs&#8230;</a></li>
<li><a href='http://bretthutley.com/2009/11/17/emacs-and-rails/' rel='bookmark' title='Emacs and Ruby on Rails'>Emacs and Ruby on Rails</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was working on my website <a href="http://www.validatemodel.com">ValidateModel.com</a>, and I wanted a way to protect files that are uploaded by the users. My solution is to encrypt the files with gpg when they are uploaded. Only the public key is stored on the server and the files are encrypted with this. The only way for the files to be decrypted is for them to be downloaded and then decrypted with my private key.</p>
<p>The steps needed in order to achieve this are:</p>
<ol>
<li>Obtain gpg and generate a public/private key if you don't already have one (gpg --gen-key)</li>
<li>Export your public key to a file (gpg -a --export &gt; pubkey.txt)</li>
<li>Upload the pubkey.txt file to your server</li>
<li>Create a directory accessible to the webserver (apache) process</li>
<li>Create a public keyring in this directory (gpg --no-default-keyring --keyring /path/to/pubring.gpg --import pubkey.txt)</li>
<li>Make sure that this file is readable by your webserver process</li>
<li>You may now encrypt files using the command line "gpg -q --batch --no-options --no-default-keyring --keyring /path/to/pubring.gpg -r brett --always-trust --output encrypted.enc --encrypt unencrypted.txt".</li>
</ol>
<p>Make sure you back up your private keyring - if you lose it, your files will NEVER be decrypted!</p>


<p>Related posts:<ol><li><a href='http://bretthutley.com/2009/09/04/convert-wma-files-to-mp3/' rel='bookmark' title='Converting WMA files to MP3'>Converting WMA files to MP3</a></li>
<li><a href='http://bretthutley.com/2006/01/04/using-cvs-and-ssh-under-emacs/' rel='bookmark' title='Using CVS and ssh under Emacs&#8230;'>Using CVS and ssh under Emacs&#8230;</a></li>
<li><a href='http://bretthutley.com/2009/11/17/emacs-and-rails/' rel='bookmark' title='Emacs and Ruby on Rails'>Emacs and Ruby on Rails</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://bretthutley.com/2007/11/29/using-gpg-to-encrypt-files-on-a-web-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

