<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Username as password salt</title>
	<atom:link href="http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/</link>
	<description>Callum on life</description>
	<lastBuildDate>Tue, 07 Feb 2012 21:09:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Salt&#8217;n&#8217;Pepper &#8211; Username als Pepper zum Salt &#124; PHPFlüsterer</title>
		<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/comment-page-1/#comment-103176</link>
		<dc:creator>Salt&#8217;n&#8217;Pepper &#8211; Username als Pepper zum Salt &#124; PHPFlüsterer</dc:creator>
		<pubDate>Thu, 05 Jan 2012 07:47:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.callum-macdonald.com/?p=616#comment-103176</guid>
		<description>[...] Ganz neu scheint diese Idee oder der Gedanke jedenfalls nicht zu sein (siehe hier). [...]</description>
		<content:encoded><![CDATA[<p>[...] Ganz neu scheint diese Idee oder der Gedanke jedenfalls nicht zu sein (siehe hier). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benjamin Carl - PHP continuous-integration test-driven-development qualit&#228;tssicherung software-architektur - &#187; Salt&#8217;n&#8217;Pepper &#8211; Username als Pepper zum Salt für den Hash</title>
		<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/comment-page-1/#comment-44597</link>
		<dc:creator>Benjamin Carl - PHP continuous-integration test-driven-development qualit&#228;tssicherung software-architektur - &#187; Salt&#8217;n&#8217;Pepper &#8211; Username als Pepper zum Salt für den Hash</dc:creator>
		<pubDate>Sat, 13 Mar 2010 21:10:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.callum-macdonald.com/?p=616#comment-44597</guid>
		<description>[...] Ganz neu scheint diese Idee oder der Gedanke jedenfalls nicht zu sein (siehe hier). [...]</description>
		<content:encoded><![CDATA[<p>[...] Ganz neu scheint diese Idee oder der Gedanke jedenfalls nicht zu sein (siehe hier). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tes</title>
		<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/comment-page-1/#comment-33852</link>
		<dc:creator>Tes</dc:creator>
		<pubDate>Fri, 20 Feb 2009 18:25:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.callum-macdonald.com/?p=616#comment-33852</guid>
		<description>You are correct that double salting the password with a private salt(username) and a public salt(domain) would require a new brute force attack for each password. However, you are better off using unknown/unknowable salts.

If the attacker doesn&#039;t know any of the three, their brute force would look like:
{guess}{guess}{guess}
{guess1}{guess}{guess}
.
.
{guess}{guess1}{guess}...

If the attacker does know one or more of the salts:
salt{guess}{guess} or salt{guess}salt
salt{guess1}{guess} or salt{guess1}salt...

So you lower the amount of work they would need to do to break any one particular password by using salts they could know.

Here&#039;s what I do:
I generated a very long random string using every kind of character. I keep it in my php scripts and that is the same for all my passwords.
Then I add another row to my users table to store a private salt for each user, which is generated and stored automatically by PHP when the user registers. 

When a user logs in I take the username they entered, get the private salt with it, add the public salt, hash it and check against the stored password. A hacker would have to compromise both the php script AND the database to get both the salts.

Finally, this is all mostly useless if you&#039;re using md5 which has been broken in oh so many ways(though not completely). I would use something like whirlpool or sha-1[if you trust the government ;)]</description>
		<content:encoded><![CDATA[<p>You are correct that double salting the password with a private salt(username) and a public salt(domain) would require a new brute force attack for each password. However, you are better off using unknown/unknowable salts.</p>
<p>If the attacker doesn&#8217;t know any of the three, their brute force would look like:<br />
{guess}{guess}{guess}<br />
{guess1}{guess}{guess}<br />
.<br />
.<br />
{guess}{guess1}{guess}&#8230;</p>
<p>If the attacker does know one or more of the salts:<br />
salt{guess}{guess} or salt{guess}salt<br />
salt{guess1}{guess} or salt{guess1}salt&#8230;</p>
<p>So you lower the amount of work they would need to do to break any one particular password by using salts they could know.</p>
<p>Here&#8217;s what I do:<br />
I generated a very long random string using every kind of character. I keep it in my php scripts and that is the same for all my passwords.<br />
Then I add another row to my users table to store a private salt for each user, which is generated and stored automatically by PHP when the user registers. </p>
<p>When a user logs in I take the username they entered, get the private salt with it, add the public salt, hash it and check against the stored password. A hacker would have to compromise both the php script AND the database to get both the salts.</p>
<p>Finally, this is all mostly useless if you&#8217;re using md5 which has been broken in oh so many ways(though not completely). I would use something like whirlpool or sha-1[if you trust the government <img src='http://www.callum-macdonald.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/comment-page-1/#comment-31438</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Wed, 05 Nov 2008 07:16:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.callum-macdonald.com/?p=616#comment-31438</guid>
		<description>Or if you use uniqueidentifiers, use that for the salt</description>
		<content:encoded><![CDATA[<p>Or if you use uniqueidentifiers, use that for the salt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Callum</title>
		<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/comment-page-1/#comment-28148</link>
		<dc:creator>Callum</dc:creator>
		<pubDate>Sun, 15 Jun 2008 02:52:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.callum-macdonald.com/?p=616#comment-28148</guid>
		<description>@&lt;a href=&quot;http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/#comment-28147&quot; rel=&quot;nofollow&quot;&gt;Morgan Tocker&lt;/a&gt;: Thanks for chiming in.

It&#039;s true that you could build your own hash database, but would it not be prohibitively expensive (time and disk wise)? I thought the beauty of rainbow table attacks is that you precompute the rainbow table once, then you can store it indefinitely. Whereas I haven&#039;t heard the argument that the principle of hashing in itself is flawed.

I understood that passwords were stored as salted hashes so that a rainbow table would be useless. In effect, an attacker would need to generate a new rainbow table for every user, which would be prohibitively expensive.

I think I&#039;ll go with something like md5( username . password . domain ). It would be possible from that data to break the passwords, but it would require a *huge* amount of work.</description>
		<content:encoded><![CDATA[<p>@<a href="http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/#comment-28147" rel="nofollow">Morgan Tocker</a>: Thanks for chiming in.</p>
<p>It&#8217;s true that you could build your own hash database, but would it not be prohibitively expensive (time and disk wise)? I thought the beauty of rainbow table attacks is that you precompute the rainbow table once, then you can store it indefinitely. Whereas I haven&#8217;t heard the argument that the principle of hashing in itself is flawed.</p>
<p>I understood that passwords were stored as salted hashes so that a rainbow table would be useless. In effect, an attacker would need to generate a new rainbow table for every user, which would be prohibitively expensive.</p>
<p>I think I&#8217;ll go with something like md5( username . password . domain ). It would be possible from that data to break the passwords, but it would require a *huge* amount of work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morgan Tocker</title>
		<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/comment-page-1/#comment-28147</link>
		<dc:creator>Morgan Tocker</dc:creator>
		<pubDate>Sun, 15 Jun 2008 02:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.callum-macdonald.com/?p=616#comment-28147</guid>
		<description>It&#039;s not devoid of use, but As Alex pointed out - it&#039;s probably better to keep that known constant hidden and treat it like a password in itself.  That way nobody else can build their own hash database (easily) by just starting from MD5(salt . &#039;a&#039;) .. MD5(salt . &#039;b&#039;) etc.

FWIW, the largest hash database I know of is Gdata (http://gdataonline.com/).  Presumably from their homepage they have 670M hashes - which is just a bit less than 64^5.

The storage cost for 64^5 is 4G just for the hashes - and for 64^6 it&#039;s 256G, so it starts to get expensive quickly.</description>
		<content:encoded><![CDATA[<p>It&#8217;s not devoid of use, but As Alex pointed out &#8211; it&#8217;s probably better to keep that known constant hidden and treat it like a password in itself.  That way nobody else can build their own hash database (easily) by just starting from MD5(salt . &#8216;a&#8217;) .. MD5(salt . &#8216;b&#8217;) etc.</p>
<p>FWIW, the largest hash database I know of is Gdata (<a href="http://gdataonline.com/" rel="nofollow">http://gdataonline.com/</a>).  Presumably from their homepage they have 670M hashes &#8211; which is just a bit less than 64^5.</p>
<p>The storage cost for 64^5 is 4G just for the hashes &#8211; and for 64^6 it&#8217;s 256G, so it starts to get expensive quickly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Callum</title>
		<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/comment-page-1/#comment-28140</link>
		<dc:creator>Callum</dc:creator>
		<pubDate>Fri, 13 Jun 2008 08:43:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.callum-macdonald.com/?p=616#comment-28140</guid>
		<description>An excellent point Alex, I knew you&#039;d chime in with something useful! :)

So simply combining the two would not provide adequate protection against rainbow attacks. Very true. But the two combined with a known constant, such as the site URL, would presumably overcome this issue. Each record would be individually unique, and the whole namespace would also be globally unique.</description>
		<content:encoded><![CDATA[<p>An excellent point Alex, I knew you&#8217;d chime in with something useful! <img src='http://www.callum-macdonald.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So simply combining the two would not provide adequate protection against rainbow attacks. Very true. But the two combined with a known constant, such as the site URL, would presumably overcome this issue. Each record would be individually unique, and the whole namespace would also be globally unique.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.callum-macdonald.com/2008/06/13/username-as-password-salt/comment-page-1/#comment-28139</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 13 Jun 2008 08:40:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.callum-macdonald.com/?p=616#comment-28139</guid>
		<description>... only that the username is frequently a known quantity, particularly for users such as &#039;admin&#039; or &#039;root&#039; that you might reasonably want to attack. Since the point of salt is to eliminate pre-calculated hashes being used in a dictionary attack, it doesn&#039;t help when a set of pre-calculated hashes can be created with the salt &#039;admin&#039; or &#039;root&#039;.</description>
		<content:encoded><![CDATA[<p>&#8230; only that the username is frequently a known quantity, particularly for users such as &#8216;admin&#8217; or &#8216;root&#8217; that you might reasonably want to attack. Since the point of salt is to eliminate pre-calculated hashes being used in a dictionary attack, it doesn&#8217;t help when a set of pre-calculated hashes can be created with the salt &#8216;admin&#8217; or &#8216;root&#8217;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

