<?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: Let&#8217;s talk about your password model</title>
	<atom:link href="http://www.dereleased.com/2010/02/09/lets-talk-about-your-password-model/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dereleased.com/2010/02/09/lets-talk-about-your-password-model/</link>
	<description>Information Saturation</description>
	<lastBuildDate>Wed, 17 Feb 2010 05:30:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Clark</title>
		<link>http://www.dereleased.com/2010/02/09/lets-talk-about-your-password-model/comment-page-1/#comment-252</link>
		<dc:creator>Clark</dc:creator>
		<pubDate>Wed, 17 Feb 2010 05:30:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereleased.com/?p=151#comment-252</guid>
		<description>I will edit some new details into the article soon, but for now this part is important.

If you use a static salt, you&#039;re doing yourself a disservice; using a static salt is just as bad as using no salt at all.  Once they break the salt, it&#039;s just a matter of generating one new table and the database is just as compromised.  Using a salt based on other user data (username, etc) is a step in the right direction, but dangerous if that data can ever change (as it will destroy your ability to check the password).

When using a random salt, leaving it in the generated string is just fine, because it will still require the cracker to generate a new table/attack vector for each individual password in the table, which is the goal of using the salt.  You, however, will need to be able to retrieve that salt on a whim, so prepending it to the generated hash (as crypt automatically does) is a logical way of doing it.

One again, using a static salt is as bad as no salt at all.  Check out that paper from M.I.T. linked near the beginning for info on why (long story short, once someone knows your never-changing salt they are in control, and they will find out).  And, storing the generated salt right there with the password is a recognized A-OK technique.  Generating a salt yourself every time couldn&#039;t be easier:&lt;pre lang=&quot;PHP&quot;&gt;crypt($password, &#039;$2a$07$&#039; . md5(microtime()));&lt;/pre&gt;

Finally, if you wanted to store the salt string separately (or just want to be able to separate them), the hash is only the last 32 chars, e.g.&lt;pre lang=&quot;PHP&quot;&gt;$hash_without_salt = substr($hash_with_salt, -32);&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I will edit some new details into the article soon, but for now this part is important.</p>
<p>If you use a static salt, you&#8217;re doing yourself a disservice; using a static salt is just as bad as using no salt at all.  Once they break the salt, it&#8217;s just a matter of generating one new table and the database is just as compromised.  Using a salt based on other user data (username, etc) is a step in the right direction, but dangerous if that data can ever change (as it will destroy your ability to check the password).</p>
<p>When using a random salt, leaving it in the generated string is just fine, because it will still require the cracker to generate a new table/attack vector for each individual password in the table, which is the goal of using the salt.  You, however, will need to be able to retrieve that salt on a whim, so prepending it to the generated hash (as crypt automatically does) is a logical way of doing it.</p>
<p>One again, using a static salt is as bad as no salt at all.  Check out that paper from M.I.T. linked near the beginning for info on why (long story short, once someone knows your never-changing salt they are in control, and they will find out).  And, storing the generated salt right there with the password is a recognized A-OK technique.  Generating a salt yourself every time couldn&#8217;t be easier:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">crypt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$password</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'$2a$07$'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Finally, if you wanted to store the salt string separately (or just want to be able to separate them), the hash is only the last 32 chars, e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$hash_without_salt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hash_with_salt</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">32</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Confused man</title>
		<link>http://www.dereleased.com/2010/02/09/lets-talk-about-your-password-model/comment-page-1/#comment-251</link>
		<dc:creator>Confused man</dc:creator>
		<pubDate>Tue, 16 Feb 2010 23:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereleased.com/?p=151#comment-251</guid>
		<description>gah, i misread it &quot;/&quot; and &quot;+&quot; are the alphabet characters you can use. I&#039;d add that somewhere in your article so that those of us who are confused can be helped a bit better. Sorry about all of these comments but since you can&#039;t edit any post you say without actually being approved i had no other way of editing things as i realized hwo foolish i was.</description>
		<content:encoded><![CDATA[<p>gah, i misread it &#8220;/&#8221; and &#8220;+&#8221; are the alphabet characters you can use. I&#8217;d add that somewhere in your article so that those of us who are confused can be helped a bit better. Sorry about all of these comments but since you can&#8217;t edit any post you say without actually being approved i had no other way of editing things as i realized hwo foolish i was.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Confused man</title>
		<link>http://www.dereleased.com/2010/02/09/lets-talk-about-your-password-model/comment-page-1/#comment-250</link>
		<dc:creator>Confused man</dc:creator>
		<pubDate>Tue, 16 Feb 2010 23:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereleased.com/?p=151#comment-250</guid>
		<description>nevermind, i tried it for myself, after trying around with a static salt set by myself, and it seems to be working just fine. i&#039;m just going to have to remove said salt from the string itself or else the hacker once getting into the database will be able to get it all. I&#039;m probably just going to use some sort of explode type thing and use the &quot;.&quot; character as the point of explosion, since that&#039;s what the crypt seems that it&#039;s set to put that before the actual encrypted string. Thanks for explaining this in greater detail for me. Now i can finally use this thing. If you wish to delete the other comment so be it, i just was posting without understand how it all worked since i was planning on using a sha256 encryption, but now realizing how easy it&#039;s going to be to use(allbeit i can&#039;t use any special character for the salt even a &quot;-&quot;,&quot;+&quot;).</description>
		<content:encoded><![CDATA[<p>nevermind, i tried it for myself, after trying around with a static salt set by myself, and it seems to be working just fine. i&#8217;m just going to have to remove said salt from the string itself or else the hacker once getting into the database will be able to get it all. I&#8217;m probably just going to use some sort of explode type thing and use the &#8220;.&#8221; character as the point of explosion, since that&#8217;s what the crypt seems that it&#8217;s set to put that before the actual encrypted string. Thanks for explaining this in greater detail for me. Now i can finally use this thing. If you wish to delete the other comment so be it, i just was posting without understand how it all worked since i was planning on using a sha256 encryption, but now realizing how easy it&#8217;s going to be to use(allbeit i can&#8217;t use any special character for the salt even a &#8220;-&#8221;,&#8221;+&#8221;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Confused man</title>
		<link>http://www.dereleased.com/2010/02/09/lets-talk-about-your-password-model/comment-page-1/#comment-249</link>
		<dc:creator>Confused man</dc:creator>
		<pubDate>Tue, 16 Feb 2010 23:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereleased.com/?p=151#comment-249</guid>
		<description>Ok, this is one thing i don&#039;t understand. Maybe you can clarify this for me. If you&#039;re telling it to make it&#039;s own salt on the fly for the bcrypt, wouldn&#039;t this make password validation impossible?

Since each salt makes the end encryption different? Wouldn&#039;t this render this type of hashing completely and utterly pointless?</description>
		<content:encoded><![CDATA[<p>Ok, this is one thing i don&#8217;t understand. Maybe you can clarify this for me. If you&#8217;re telling it to make it&#8217;s own salt on the fly for the bcrypt, wouldn&#8217;t this make password validation impossible?</p>
<p>Since each salt makes the end encryption different? Wouldn&#8217;t this render this type of hashing completely and utterly pointless?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

