<?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: How To Protect Your Users From Password Theft</title>
	<atom:link href="http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/</link>
	<description>Application security testing, analysis, and metrics</description>
	<lastBuildDate>Thu, 09 Feb 2012 11:59:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Fünf Zeichen sind (manchmal) genug &#171; Erich sieht</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2537</link>
		<dc:creator>Fünf Zeichen sind (manchmal) genug &#171; Erich sieht</dc:creator>
		<pubDate>Mon, 09 Feb 2009 20:55:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2537</guid>
		<description>[...] (Online-Angriff) oder eben mit dem Hashwert (offline), wenn er ihn kennt. Der Hashwert ist das, was man normalerweise von einem Passwort speichert. Daraus lässt sich das Passwort nicht berechnen, aber man kann umgekehrt den Hashwert eines [...]</description>
		<content:encoded><![CDATA[<p>[...] (Online-Angriff) oder eben mit dem Hashwert (offline), wenn er ihn kennt. Der Hashwert ist das, was man normalerweise von einem Passwort speichert. Daraus lässt sich das Passwort nicht berechnen, aber man kann umgekehrt den Hashwert eines [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Eng</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2522</link>
		<dc:creator>Chris Eng</dc:creator>
		<pubDate>Mon, 02 Feb 2009 16:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2522</guid>
		<description>@Tejedinne:

One SQL injection vulnerability gives you the password for all the users when said passwords are stored in the clear.

Yes, in many situations, you could also use a SQL injection vulnerability to overwrite a stored password hash.  However, this isn&#039;t particularly stealthy and it&#039;ll be pretty obvious to the victim when he tries to login and can&#039;t.  I wasn&#039;t suggesting that people use unsalted hashes -- that&#039;s why immediately after describing unsalted hashes, I pointed out the rainbow table attack.

As for dropping tables or databases, that causes disruption but it doesn&#039;t help the attacker.  They&#039;re usually after the data so it doesn&#039;t do them much good to delete it.  Information is king.

The &quot;CWE/SANS Top 25 Most Dangerous Programming Errors&quot; post was Chris Wysopal&#039;s, not mine.  I&#039;m sure he&#039;ll respond to you when he gets some time.</description>
		<content:encoded><![CDATA[<p>@Tejedinne:</p>
<p>One SQL injection vulnerability gives you the password for all the users when said passwords are stored in the clear.</p>
<p>Yes, in many situations, you could also use a SQL injection vulnerability to overwrite a stored password hash.  However, this isn&#8217;t particularly stealthy and it&#8217;ll be pretty obvious to the victim when he tries to login and can&#8217;t.  I wasn&#8217;t suggesting that people use unsalted hashes &#8212; that&#8217;s why immediately after describing unsalted hashes, I pointed out the rainbow table attack.</p>
<p>As for dropping tables or databases, that causes disruption but it doesn&#8217;t help the attacker.  They&#8217;re usually after the data so it doesn&#8217;t do them much good to delete it.  Information is king.</p>
<p>The &#8220;CWE/SANS Top 25 Most Dangerous Programming Errors&#8221; post was Chris Wysopal&#8217;s, not mine.  I&#8217;m sure he&#8217;ll respond to you when he gets some time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tejeddine Mouelhi</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2519</link>
		<dc:creator>Tejeddine Mouelhi</dc:creator>
		<pubDate>Mon, 02 Feb 2009 10:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2519</guid>
		<description>You wrote &#039;an attacker just needs to find one SQL Injection vulnerability and he’s got the password for every one of your users.&#039;

I am a little bit confused. I thought that &#039;one SQL injection vulnerability&#039; can update the database to store a one way hashed password. In that case, the solution you propose does not work (except for the one improved with salt).
And beyond that I will even say that SQLIA is worse than password theft, you can drop tables/database or even shutdown the server.

Am i missing something here ?

Kinds regards,
P.S. You did not react to my reply on &#039;CWE/SANS Top 25 Most Dangerous Programming Errors&#039; post</description>
		<content:encoded><![CDATA[<p>You wrote &#8216;an attacker just needs to find one SQL Injection vulnerability and he’s got the password for every one of your users.&#8217;</p>
<p>I am a little bit confused. I thought that &#8216;one SQL injection vulnerability&#8217; can update the database to store a one way hashed password. In that case, the solution you propose does not work (except for the one improved with salt).<br />
And beyond that I will even say that SQLIA is worse than password theft, you can drop tables/database or even shutdown the server.</p>
<p>Am i missing something here ?</p>
<p>Kinds regards,<br />
P.S. You did not react to my reply on &#8216;CWE/SANS Top 25 Most Dangerous Programming Errors&#8217; post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Eng</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2497</link>
		<dc:creator>Chris Eng</dc:creator>
		<pubDate>Wed, 28 Jan 2009 21:20:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2497</guid>
		<description>@Klau:

Let&#039;s assume that the time to recover a password stored as an unsalted SHA-1 is zero (it&#039;s not, because the lookup takes a finite amount of time).  But it&#039;s pretty fast. The reason it&#039;s fast is because you&#039;ve pre-calculated the hashes for all possible inputs.

Now let&#039;s assume that you&#039;re trying to recover a password stored as a salted SHA-1 hash, where the salt is 64 bits.  Unless you had some serious computational resources and storage available to you, you probably don&#039;t have 2^64 pre-computed rainbow tables (corresponding to each of the 2^64 possible salt values).  Since you don&#039;t have a rainbow table, you can&#039;t simply look up the hash, so your only option is to use brute force.  Now you have to calculate the hash for billions of possible passwords until you eventually find the one you&#039;re looking for.  If we brute force all possible 8-character alphanumeric passwords, you&#039;ll have to do that calculation (62^8)/2, or 109 trillion times, on average, before you recover the password.  That&#039;s what we affectionately refer to as &quot;computationally infeasible.&quot;

If you throw away the salt, then you can&#039;t recover the password.  But neither can the authentication routine, which is why you have to store it alongside the password.</description>
		<content:encoded><![CDATA[<p>@Klau:</p>
<p>Let&#8217;s assume that the time to recover a password stored as an unsalted SHA-1 is zero (it&#8217;s not, because the lookup takes a finite amount of time).  But it&#8217;s pretty fast. The reason it&#8217;s fast is because you&#8217;ve pre-calculated the hashes for all possible inputs.</p>
<p>Now let&#8217;s assume that you&#8217;re trying to recover a password stored as a salted SHA-1 hash, where the salt is 64 bits.  Unless you had some serious computational resources and storage available to you, you probably don&#8217;t have 2^64 pre-computed rainbow tables (corresponding to each of the 2^64 possible salt values).  Since you don&#8217;t have a rainbow table, you can&#8217;t simply look up the hash, so your only option is to use brute force.  Now you have to calculate the hash for billions of possible passwords until you eventually find the one you&#8217;re looking for.  If we brute force all possible 8-character alphanumeric passwords, you&#8217;ll have to do that calculation (62^8)/2, or 109 trillion times, on average, before you recover the password.  That&#8217;s what we affectionately refer to as &#8220;computationally infeasible.&#8221;</p>
<p>If you throw away the salt, then you can&#8217;t recover the password.  But neither can the authentication routine, which is why you have to store it alongside the password.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Eng</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2496</link>
		<dc:creator>Chris Eng</dc:creator>
		<pubDate>Wed, 28 Jan 2009 21:08:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2496</guid>
		<description>@Peter:

Ah, I get it now. You&#039;re the one actually issuing the CHAP challenge, so you need the plaintext password in order to calculate and verify the hash (or whatever sort of calculation CHAP uses for the verification step, I can&#039;t remember).  Thanks for the clarification; it&#039;s always interesting to hear stories from the field.</description>
		<content:encoded><![CDATA[<p>@Peter:</p>
<p>Ah, I get it now. You&#8217;re the one actually issuing the CHAP challenge, so you need the plaintext password in order to calculate and verify the hash (or whatever sort of calculation CHAP uses for the verification step, I can&#8217;t remember).  Thanks for the clarification; it&#8217;s always interesting to hear stories from the field.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2493</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 28 Jan 2009 17:28:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2493</guid>
		<description>@Chris:

The situation I was referring to is if you are writing an authentication backend supporting multiple clients.  The clients under your control should absolutely support protocols allowing hashed passwords, as you suggest.  If you are required to support a client that only supports CHAP or EAP-MD5, for instance, your backend still has to have access to the plaintext password.

I&#039;m not trying to criticize your article - it&#039;s very good.  I recently was unfortunate enough to have to &#039;break&#039; a system implemented as you suggest so that it can support legacy protocols, and thought others might appreciate the heads up.  In my case, I force the administrator to explicitly enable reversibly encrypted passwords and accept the lowered security (similar to the approach taken by MS IAS.)</description>
		<content:encoded><![CDATA[<p>@Chris:</p>
<p>The situation I was referring to is if you are writing an authentication backend supporting multiple clients.  The clients under your control should absolutely support protocols allowing hashed passwords, as you suggest.  If you are required to support a client that only supports CHAP or EAP-MD5, for instance, your backend still has to have access to the plaintext password.</p>
<p>I&#8217;m not trying to criticize your article &#8211; it&#8217;s very good.  I recently was unfortunate enough to have to &#8216;break&#8217; a system implemented as you suggest so that it can support legacy protocols, and thought others might appreciate the heads up.  In my case, I force the administrator to explicitly enable reversibly encrypted passwords and accept the lowered security (similar to the approach taken by MS IAS.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Klau</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2490</link>
		<dc:creator>Klau</dc:creator>
		<pubDate>Wed, 28 Jan 2009 11:08:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2490</guid>
		<description>I am a little bit slower, but I still didn&#039;t understood a few things from your post:
suppose the time to break the MD5/SHA-1 hash is x

1. a) using a salt, can it be cracked using the rainbow tables assuming that you don&#039;t know the salt? how much is x now?
b) same question, but this time supposing that you have no idea what&#039;s the value of the salt</description>
		<content:encoded><![CDATA[<p>I am a little bit slower, but I still didn&#8217;t understood a few things from your post:<br />
suppose the time to break the MD5/SHA-1 hash is x</p>
<p>1. a) using a salt, can it be cracked using the rainbow tables assuming that you don&#8217;t know the salt? how much is x now?<br />
b) same question, but this time supposing that you have no idea what&#8217;s the value of the salt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Eng</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2489</link>
		<dc:creator>Chris Eng</dc:creator>
		<pubDate>Wed, 28 Jan 2009 06:46:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2489</guid>
		<description>@Nate:

Thanks.  Yes, that point is definitely worth calling out -- I should have emphasized that.  I could write an entire post on &quot;don&#039;t roll your own&quot; (and you could probably write dozens).  ;)

@Patrick:

I tried to allude to that with the example of md5crypt using 1000 iterations.  But I wasn&#039;t aware that the practice was called &quot;key stretching.&quot;</description>
		<content:encoded><![CDATA[<p>@Nate:</p>
<p>Thanks.  Yes, that point is definitely worth calling out &#8212; I should have emphasized that.  I could write an entire post on &#8220;don&#8217;t roll your own&#8221; (and you could probably write dozens).  ;)</p>
<p>@Patrick:</p>
<p>I tried to allude to that with the example of md5crypt using 1000 iterations.  But I wasn&#8217;t aware that the practice was called &#8220;key stretching.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2487</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 27 Jan 2009 20:27:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2487</guid>
		<description>Don&#039;t forget to consider key stretching as an additional countermeasure to salting for weak passwords: http://en.wikipedia.org/wiki/Key_strengthening</description>
		<content:encoded><![CDATA[<p>Don&#8217;t forget to consider key stretching as an additional countermeasure to salting for weak passwords: <a href="http://en.wikipedia.org/wiki/Key_strengthening" rel="nofollow">http://en.wikipedia.org/wiki/Key_strengthening</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/comment-page-1/#comment-2485</link>
		<dc:creator>Nate</dc:creator>
		<pubDate>Tue, 27 Jan 2009 17:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650#comment-2485</guid>
		<description>Good article, but it misses one key point: use an existing implementation of all these functions, don&#039;t roll your own. The OpenBSD crypt(3) supports all these features and more (including variable-length hashing to slow an attacker even more). The chance of someone making a mistake when reimplementing this is high, especially someone not familiar with all the security evolution the original went through (8 char limit anyone?)

There are even implementations for python and Java:
http://www.mindrot.org/projects/py-bcrypt/
http://www.mindrot.org/projects/jBCrypt/</description>
		<content:encoded><![CDATA[<p>Good article, but it misses one key point: use an existing implementation of all these functions, don&#8217;t roll your own. The OpenBSD crypt(3) supports all these features and more (including variable-length hashing to slow an attacker even more). The chance of someone making a mistake when reimplementing this is high, especially someone not familiar with all the security evolution the original went through (8 char limit anyone?)</p>
<p>There are even implementations for python and Java:<br />
<a href="http://www.mindrot.org/projects/py-bcrypt/" rel="nofollow">http://www.mindrot.org/projects/py-bcrypt/</a><br />
<a href="http://www.mindrot.org/projects/jBCrypt/" rel="nofollow">http://www.mindrot.org/projects/jBCrypt/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

