<?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>e-ignite &#187; Tutorials</title>
	<atom:link href="http://www.e-ignite.co.uk/blog/archives/category/tutorials/feed" rel="self" type="application/rss+xml" />
	<link>http://www.e-ignite.co.uk/blog</link>
	<description>Security and Privacy related stories - what&#039;s in the news just now?</description>
	<lastBuildDate>Tue, 28 Apr 2009 18:18:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Tutorial: Choosing the right SHA settings</title>
		<link>http://www.e-ignite.co.uk/blog/archives/52</link>
		<comments>http://www.e-ignite.co.uk/blog/archives/52#comments</comments>
		<pubDate>Sat, 09 Dec 2006 13:41:36 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.e-ignite.co.uk/blog/archives/tutorials/52</guid>
		<description><![CDATA[By far the most common search queries for people visiting my main site are about SHA settings with GnuPG.? These are a little complex, and depend on the type of key that you use (see my totorial on generating keys for more details on doing this), but once you understand what SHA algorithms do, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>By far the most common search queries for people visiting my <a href="http://www.e-ignite.co.uk" title="e-ignite homepage">main site</a> are about SHA settings with GnuPG.?  These are a little complex, and depend on the type of key that you use (see my totorial on <a href="http://www.e-ignite.co.uk/blog/archives/tutorials/49" title="Tutorial:  How to generate and distribute keys">generating keys</a> for more details on doing this), but once you understand what SHA algorithms do, it&#8217;s not quite so daunting</p>
<p><span id="more-52"></span></p>
<ul>
<li><strong>What is SHA?</strong></li>
</ul>
<p>SHA stands for Secure Hash Algorithm.?  This is the mathematical method of generating a signature on your files or emails.?  It uses your private key so that you and only you can sign an email or file &#8211; this way, if the email is changed in any way before the recipient receives it, or if the file you placed on the internet is replaced without your knowledge, the signature verification will fail and this will show that it is not the original email or file that you sent.</p>
<ul>
<li><strong>What algorithms are available?</strong></li>
</ul>
<p>There are several SHA algorithms avaliable &#8211; these are RIPEMD160, SHA-1, SHA224, SHA256, SHA384 and SHA512.?  There are others such as Whirlpool and IDEA, but these are not included in OpenPGP or Enigmail.</p>
<ul>
<li><strong>What SHA settings should I use?</strong></li>
</ul>
<p>There is no &#8220;right answer&#8221; to this question &#8211; to some extent, this is an entirely personal choice.?  If you have a DSA signature key, you will need to use a 160 bit hash function (for example, RIPEMD160 or SHA-1) unless you have the most recent version of <a href="http://www.gnupg.org" title="GnuPG website">GnuPG</a>.?  If you enable DSA2, this will allow you to use either SHA224 or SHA256 with your DSA key &#8211; see <a href="http://www.e-ignite.co.uk/html/key_types.html#DSA2" title="Enable DSA2 in Enigmail">this page</a> for full instructions on enabling DSA2.</p>
<p>Arguably, 160 bit hash functions are becoming less and less secure.?  There have been several published problems with SHA-1 security including the potential ability to break the function without having to try a full brute-force attack and try every possible code combination.?  There is a very good <a href="http://en.wikipedia.org/wiki/SHA" title="Wikipedia:  SHA">Wikipedia article on SHA</a> if you&#8217;re interested in reading more about the weaknesses.</p>
<p>Because of the weaknesses in SHA-1 and RIPEMD160, I would recommend that you use DSA2 with any DSA signing keys.?  If you enable DSA2, you will be able to use SHA224 and SHA256 with any existing DSA key.?  However, if you do not yet have a key, or don&#8217;t mind replacing your original, I would highly recommend that you use an RSA key.</p>
<p>RSA keys support virtually all hash functions.?  This opens up opportunities to use the most secure hash functions including SHA256, SHA384 and SHA512. ?  There are few drawbacks to the use of SHA512 &#8211; namely that it increases the size of the signature (which isn&#8217;t really a problem at all), and that it&#8217;s not fully supported on some clients.?  If everyone you communicate with has Thunderbird and Enigmail (or <a href="http://www.e-ignite.co.uk/blog/archives/general/16" title="Mobility Email">Mobility Email</a>) then you can freely use SHA512 without any problems.?  Some systems (especially older products) only support up to SHA256, although this is changing rapidly.</p>
<ul>
<li><strong>So how do I change my SHA settings?</strong></li>
</ul>
<p>In Enigmail, this is really easy.?  Simply go to OpenPGP &gt; PREFERENCES and select the PGP/MIME tab.?  There&#8217;s a drop-down box?  with a list of SHA options &#8211; just select one and hit?  OK.</p>
<p style="text-align: center"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/sha_selection.jpg" alt="SHA Options in Enigmail" id="image51" /></p>
<p>If you use OpenPGP with other applications (such as <a href="http://gpgee.excelcia.org/" title="GPGee">GPGee</a> for file signing and verification) then you may have to edit your GPG.conf file.?  To do so, simply go to your GPG Home Directory (on Windows XP / 2000, the default is <em>C:\Documents and Settings\[user]\Application Data\GnuPG\</em>) and open GPG.conf with Notepad or another text editor.?  All you have to do is enter the following to a new line then save the file:</p>
<p><em>digest-algo SHA256</em> &#8211; just replace SHA256 with your preferred algorithm.</p>
<p>If you use a DSA key and you want to set a default SHA setting in GPG.conf, enter the following:</p>
<p><em>digest-algo SHA256</em><br />
<em>enable-dsa2</em><br />
Remember with the above that you can either use SHA224 or SHA256, and you <em>must</em> add the enable DSA2 line.</p>
<p>So that&#8217;s it.?  Relatively simple once you know how, and you should only have to do this once.?  When it&#8217;s set up, the settings will be remembered for as long as Enigmail or GnuPG is installed on your computer.?  But if you still have questions, please feel free to use the comments form below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e-ignite.co.uk/blog/archives/52/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New category:  Tutorials</title>
		<link>http://www.e-ignite.co.uk/blog/archives/50</link>
		<comments>http://www.e-ignite.co.uk/blog/archives/50#comments</comments>
		<pubDate>Thu, 07 Dec 2006 20:02:40 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.e-ignite.co.uk/blog/archives/general/50</guid>
		<description><![CDATA[As part of an ongoing project, I&#8217;ll be adding several specific tutorials to this site. Most will be regarding the use of OpenPGP communication and file encryption &#8211; if you&#8217;re at all interested, just select the Tutorials link from the right hand side of the screen.]]></description>
			<content:encoded><![CDATA[<p>As part of an ongoing project, I&#8217;ll be adding several specific tutorials to this site.  Most will be regarding the use of OpenPGP communication and file encryption &#8211; if you&#8217;re at all interested, just select the <a href="http://www.e-ignite.co.uk/blog/archives/category/tutorials/" title="Tutorials">Tutorials</a> link from the right hand side of the screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e-ignite.co.uk/blog/archives/50/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial:  How to generate and distribute your keys</title>
		<link>http://www.e-ignite.co.uk/blog/archives/49</link>
		<comments>http://www.e-ignite.co.uk/blog/archives/49#comments</comments>
		<pubDate>Thu, 07 Dec 2006 19:32:54 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.e-ignite.co.uk/blog/archives/tutorials/49</guid>
		<description><![CDATA[In order to use OpenPGP email encryption, you need a key pair. Once you have installed Thunderbird, Enigmail and GnuPG you can generate your own key pair. There are two ways &#8211; an easy way giving you a basic setup with few options, or a slightly more complex way, giving you many more options. The [...]]]></description>
			<content:encoded><![CDATA[<p>In order to use OpenPGP email encryption, you need a key pair.  Once you have installed <a href="http://www.e-ignite.co.uk/html/openpgp.html" title="Installation Instructions">Thunderbird, Enigmail and GnuPG</a> you can generate your own key pair.  There are two ways &#8211; an easy way giving you a basic setup with few options, or a slightly more complex way, giving you many more options.<span id="more-49"></span></p>
<ul>
<li><strong>The Easy Way</strong></li>
</ul>
<p>Enigmail offers you a wizard when you initially install it, and this guides you through a key generation phase.  If you aborted the wizard, it will not display again, so you will have to manually generate your keys.  Don&#8217;t worry though &#8211; this is simple.  Once you have configured your email accounts in Thunderbird (adding usernames and passwords etc), hit OpenPGP &gt; KEY MANAGEMENT.  This will give you a window similar to this:</p>
<p style="text-align: center"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/key_management.jpg" alt="Key Management" id="image39" /></p>
<p>All you have to do is go to GENERATE &gt; NEW KEY PAIR.  The following will appear:</p>
<p style="text-align: center"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/generate.jpg" alt="Generate Key" id="image41" /></p>
<p>Select your chosen email address from the drop-down list at the top, then chose a passphrase (password) &#8211; remember that you <strong>must</strong> remember this.  If you forget your passphrase, there is no way to recover it, so you will not be able to read any encrypted email you&#8217;ve sent or received using this particular key pair.</p>
<p>Next step is to set the appropriate options for the key.  A comment is optional &#8211; I normally don&#8217;t bother with a comment, but it can help you differentiate (for example) your personal-use key pair from your business-use key pair if you need to.   Expiry of the key is also optional &#8211; you can set it to expire in any amount of time you wish, or you can select the checkbox so that it never expires.</p>
<p align="left">Before you generate your key, select the &#8220;Advanced&#8221; tab:</p>
<p style="text-align: center"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/generate_advanced.jpg" alt="Generate Key - Advanced Options" id="image42" /></p>
<p>Here, you&#8217;ll be able to set up the key in a way you are comfortable with.  The default setting is for a DSA/El Gamal key pair with a 1024 bit DSA key for signing and a 2048 bit El Gamal key pair for encryption.  There are two drop-down boxes available:  one allows you to set the size of your key pair from 1024 bits (least secure) to 4096 bits (most secure) &#8211; the other drop-down box (shown expanded in the image above) allows you to change the type of key you use.  Your choice of key type is actually quite important as I&#8217;ll explain.</p>
<p>With a DSA/El Gamal key pair, the key size you specify will only alter the size of the El Gamal encryption key and not the DSA key.  The DSA key is always 1024 bits.  By using a DSA key, you are also restricting yourself to a more limited set of Secure Hash Algorithms for signing files and emails &#8211; see my tutorial on <a href="http://www.e-ignite.co.uk/blog/archives/tutorials/52" title="More information on SHA settings">Choosing the right SHA Settings</a> for further details.  Arguably, the El Gamal encryption is as secure as RSA, but takes longer to encrypt and decrypt messages.  I personally prefer to use an RSA key pair because it is compatible with a wider range of SHA settings, it&#8217;s faster than El Gamal at encryption and decryption, and RSA can be used for both encryption <span style="font-style: italic">and</span> signing, so you don&#8217;t need a separate type of key.  The disadvantage to this, however, is that there is some doubt as to the security of a large-bit key used for signing emails and files &#8211; more bits may cause a weakness in the hashing.  Enigmail only allows you to create RSA keys that are used for <span style="font-style: italic">both</span> signing and encryption &#8211; if you are at all interested in having more options, I suggest that you use the Advanced Method to generate your keys as shown below.Once you have chosen your key settings, you simply have to click &#8220;Generate Key&#8221; and it will be done.  You will be asked if you wish to create a Revocation Certificate &#8211; I would recommend that you do this.  If you forget your passphrase, a revocation certificate will allow you to revoke the key.  If you don&#8217;t have these certificates, you will need the passphrase to revoke the key (which isn&#8217;t much help if you&#8217;ve forgotten it!!!)</p>
<p>Your public and private keys are stored in the GnuPG home directory &#8211; on Windows XP and 200, this is usually:</p>
<p><span style="font-style: italic">C:\Documents and Settings\[user]\Application Data\GnuPG\</span></p>
<p align="left">To backup your keys, you should simply copy the contents of this folder and store them securely elsewhere.</p>
<p align="left">
<ul>
<li><span style="font-weight: bold">The Advanced Method</span></li>
</ul>
<p align="left">So, you want some more advanced options for key generation?  I highly recommend this as it gives you more flexibility as to the type of keys you use, the size of both the encryption and signature keys, and your choice of Secure Hash Algorithm.</p>
<p align="left">
<p align="left">First thing&#8217;s first &#8211; we need to use GnuPG with the Command Line.  This means making a small change (on Windows systems only) to make the process much simpler.  I created a <a href="http://www.e-ignite.co.uk/flash/path.htm" title="Flash Demo - Set Up the GnuPG Path on Windows">flash animation</a> with an easy step-by-step guide.</p>
<p align="left">
<p align="left">Once this is done, hit START &gt; RUN and type &#8220;cmd&#8221; into the box.  Press enter or click OK and this will launch an MS Dos prompt.  Type the following into the command prompt exactly as it appears:</p>
<p align="left">
<p align="left"><span style="font-style: italic">gpg &#8211;gen-key</span></p>
<p align="left">
<p align="left">This will give you a list of options &#8211; for the purposes of this example, I&#8217;ll create a 2048 bit RSA signing key with a 4096 bit encryption key.</p>
<p style="text-align: center"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/cmd_line.jpg" alt="Command Line - Generate Key" id="image43" /></p>
<p style="text-align: center">
<p style="text-align: left">Type &#8220;<span style="font-style: italic">5</span>&#8221; and press enter then select your key size &#8211; in this example, I used &#8220;<span style="font-style: italic">2048</span>&#8220;.  You are then given options for expiry &#8211; for a key that&#8217;s valid for 2 years, enter &#8220;<span style="font-style: italic">2y</span>&#8220;.  You&#8217;re then asked to confirm the details are correct &#8211; if they are, hit &#8220;<span style="font-style: italic">y</span>&#8221; then enter.</p>
<p style="text-align: left">&nbsp;</p>
<p style="text-align: left">Once your chosen key settings are in, you&#8217;ll be asked for your real name, your email address and a comment (which is optional).  Please note that GnuPG does not allow short names by default &#8211; under &#8220;Real Name&#8221; you will need to enter text longer than 5 characters.  There is, however, a way around this.  When you first go to generate the key, hit START &gt; RUN &gt; cmd then enter the following into the command line:</p>
<p style="text-align: left"><span style="font-style: italic">gpg &#8211;gen-key &#8211;allow-freeform-uid</span></p>
<p style="text-align: left">And this will allow you to use (for example) your first name only if you so wish.</p>
<p style="text-align: left">&nbsp;</p>
<p style="text-align: center"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/cmd_confirm.jpg" alt="Command Line - Generate Key Confirmation" id="image44" /></p>
<p align="left">You will be given a chance to confirm or change your details.  If they are correct, enter &#8220;<span style="font-style: italic">O</span>&#8221; for Okay and enter your chosen passphrase when prompted.  Again, the passphrase is extremely important &#8211; you need to remember this as it is required every time you use the keys to send or receive an encrypted email or file.</p>
<p align="left">Once done, the key will generate &#8211; this may take a few moments depending on your hardware.  Once it has generated, the screen will show details of your new key:</p>
<p style="text-align: center"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/sign_key_generated.jpg" alt="Signing Key Generated" id="image45" /></p>
<p style="text-align: left">Read the screen output &#8211; in this example, you will see that the key name is <span style="font-style: italic">9B48740F</span> &#8211; this is shown in the line above the key fingerprint:</p>
<p style="text-align: left">pub  2048R/<span style="font-style: italic">9B48740F</span></p>
<p align="left">We now need to add your subkey by editing the key you&#8217;ve just generated.  Type:</p>
<p align="left">
<p align="left">gpg &#8211;edit-key <span style="font-style: italic">9B48740F  </span><span style="font-style: italic"> </span><span style="font-style: italic">(replace 9B48740F with your key name)</span></p>
<p style="text-align: center" align="left"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/add_crypto_key.jpg" alt="Add Encryption Subkey" id="image46" /></p>
<p>Now, type <span style="font-style: italic">addkey</span> and enter your passphrase when prompted.</p>
<p align="left">Now enter your chosen options &#8211; I entered &#8220;<span style="font-style: italic">6</span>&#8221; for an RSA encryption key, &#8220;<span style="font-style: italic">4096</span>&#8221; bits and &#8220;<span style="font-style: italic">2y</span>&#8221; for a 2 year expiry:</p>
<p style="text-align: center" align="left"><img src="http://www.e-ignite.co.uk/blog/wp-content/uploads/2006/12/crypto_key_details.jpg" alt="Encryption Subkey Details" id="image47" style="font-style: italic" /></p>
<p>Once all the details are confirmed, the key will be generated for you.  Generation times for the encryption keys are generally longer than signing keys &#8211; especially when there is a larger bit-size.  It should still only take a minute or so depending on the key size and the hardware used.  Once the key is generated, you will get a confirmation message followed by a <span style="font-style: italic">Command&gt;</span> option.  You <span style="font-weight: bold">must</span> type &#8220;<span style="font-style: italic">save</span>&#8221; before you close the command prompt.</p>
<p>So that&#8217;s it!  Easy, wasn&#8217;t it?  Generally, GnuPG gets press as being &#8220;difficult to use&#8221; because it&#8217;s a command line tool, but for key generation, it&#8217;s actually very straightforward.  You can now use your advanced encryption and signing key in Thunderbird by going to the OpenPGP menu, selecting KEY MANAGEMENT &gt; FILE &gt; RELOAD KEY CACHE</p>
<p align="left">
<ul>
<li><strong>Distribute Your Keys</strong></li>
</ul>
<p align="left">So, the whole point in using encrypted communications is so that you can communicate securely.  For others to communicate with you using encrypted email or files, they need your public key.  You can do one of a few things.</p>
<p>Firstly, you could send your public key to everyone you know.  This is quite a simple way of distributing your keys, although not entirely convenient.  Not all your friends or contacts will use cryptography so you may just confuse them.  Additionally, it takes a significant amount of time to do yourself.  To send your keys by email, go to OpenPGP &gt; KEY MANAGEMENT.  Find your key in the list, right-click on it and select <em>Send Public Keys by Email</em>.  Add whoever you want to receive the keys in the &#8220;to&#8221; part of the email and hit send &#8211; it&#8217;s pretty easy to do, but maybe not ideal.</p>
<p>Secondly, you could upload your public keys to a keyserver (here is an <a href="http://keyserver.veridis.com:11371/" title="Veridis Keyserver">example of a keyserver</a>, where you can search for keys by email address, key name etc.)  This way, when someone tries to send you an encrypted email but doesn&#8217;t have your public key, they can search for it, download it and use it automatically.  This is my recommended option, although you need to appreciate that your full name and email address will be available online.</p>
<p>Finally, here&#8217;s an option that&#8217;s somewhere in the middle.  Why not upload a copy of your public key to your webspace &#8211; you can then include a link to it from your website, or in a signature automatically attached to your outgoing email.  This still means that only people you have emailed previously will be able to send you encrypted communications, but it also means that you know who has your key.</p>
<p>I hope the above was helpful &#8211; any questions / comments? Feel free to leave them below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e-ignite.co.uk/blog/archives/49/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
