<?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>Webmasters by Design LLC &#187; Security</title>
	<atom:link href="http://www.webmastersbydesign.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webmastersbydesign.com</link>
	<description></description>
	<lastBuildDate>Thu, 15 Dec 2011 03:57:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Add Salt To Make Your Encryptions Better</title>
		<link>http://www.webmastersbydesign.com/2008/07/add-salt-to-make-your-encryptions-better/</link>
		<comments>http://www.webmastersbydesign.com/2008/07/add-salt-to-make-your-encryptions-better/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 12:26:52 +0000</pubDate>
		<dc:creator>Scott Spear</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[salt]]></category>

		<guid isPermaLink="false">http://www.webmastersbydesign.com/?p=89</guid>
		<description><![CDATA[Needing Salt There are few things that aren't better once salt has been added, and encryptions are no different. Adding a salt can make a simple encryption exponentially harder to break/crack. "Salt data complicates dictionary attacks that use pre-encryption of dictionary entries: Each bit of salt used doubles the amount of storage and computation required" [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-90" title="Hacking for password" src="http://www.webmastersbydesign.com/wp-content/uploads/2008/07/encryption.jpg" alt="Encryption" width="425" height="282" /></p>
<p><span style="text-decoration: underline;"><strong>Needing Salt</strong></span></p>
<p>There are few things that aren't better once salt has been added, and encryptions are no different. Adding a salt can make a simple encryption exponentially harder to break/crack. "Salt data complicates <a title="Wikipedia Dictionary attack" href="http://en.wikipedia.org/wiki/Dictionary_attack">dictionary attacks</a> that use pre-encryption of dictionary entries: Each bit of salt used doubles the amount of storage and computation required" (<a title="Wikipedia Salt" href="http://en.wikipedia.org/wiki/Salt_(cryptography)">Wikipedia</a>). You can see that by adding a good sized salt, the encryption can become very difficult to break by dictionary or other brute force attacks. A lot of programmers rely entirely on the md5 encryption for storing passwords because it is built into both PHP and MySQL. While md5 is an easy function to implement, it is pretty easily reversed using <a title="Wikipedia Rainbow Tables" href="http://en.wikipedia.org/wiki/Rainbow_table">rainbow tables</a>. Thankfully, there are many other available encryption options that include salt, and the best part about adding salt to your encryption is how easily it can be done.</p>
<p><span style="text-decoration: underline;"><strong>Adding Salt</strong></span></p>
<ul>
<li><strong>PHP</strong> - crypt("string to encrypt","salt")</li>
<li><strong>Perl</strong> - crypt("string to encrypt","salt")</li>
<li><strong>ASP </strong>- Set crypt = Server.CreateObject("Persits.CryptoManager")<br />
Set ctx = crypt.OpenContext("", True)<br />
Set hash = ctx.CreateHash<br />
hash.AddText Request("string to encrypt") &amp; salt<br />
hashvalue = hash.Value.Hex</li>
<li><strong>Ruby On Rails</strong> - "string to encrypt".crypt("salt")</li>
<li><strong>Python</strong> - crypt("string to encrypt","salt")</li>
</ul>
<p><span style="text-decoration: underline;"><strong>Enjoying Salt</strong></span></p>
<p>Now that you have added salt to your encryption, I'm sure you would like to know how much more secure that encrypted string really is. This is actually a very easy calculation. Let's say for example that you know your users are creating easy passwords that they can remember and are therefore picking words out of the dictionary. The users are picking from let's say around 100,000 of the words in the English language. Using encryption without salt, basic brute force attacks would have to compute 100,000 hashes to find the correct one. On the other hand, if you take their password from the dictionary and add a salt, using  say a 32 bit salt, the same size as md5 encryption, you multiply the word possibilities by the salt possibilities; see below:</p>
<ul>
<li>Password Possibilities: 100,000</li>
<li>Salt Possibilities: 2^32</li>
</ul>
<address>Hash calculations needed = Password Possibilities * Salt Possibilities<br />
</address>
<address>Hash calculations needed = 100,000 * 2^32</address>
<address>Hash calculations needed = 429,496,729,600,000</address>
<p>This basic calculation shows that simply adding a salt makes the encryption <strong>4,294,967,296</strong> times harder to break.</p>
<p><span style="text-decoration: underline;"><strong>Additional Resources</strong></span></p>
<ul>
<li><a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FCryptography-Demystified-John-Hershey%2Fdp%2F0071406387%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1215522648%26sr%3D1-1&amp;tag=chriswebmares-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Cryptography Demystified</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=chriswebmares-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /></li>
<li><a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FCryptography-Dummies-Chey-Cobb%2Fdp%2F0764541889%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1215522648%26sr%3D1-3&amp;tag=chriswebmares-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Cryptography for Dummies</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=chriswebmares-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.webmastersbydesign.com/2008/07/add-salt-to-make-your-encryptions-better/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

