<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Can bcrypt&#8217;s computational expense be reduced on the server side?	</title>
	<atom:link href="https://www.hashcollisions.com/2011/06/can-bcrypts-computational-expense-be-reduced-on-the-server-side/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.hashcollisions.com/2011/06/can-bcrypts-computational-expense-be-reduced-on-the-server-side/</link>
	<description>Software development, usability, and digital culture</description>
	<lastBuildDate>Tue, 04 Aug 2020 03:53:12 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.4.2</generator>
	<item>
		<title>
		By: Alan Chandler		</title>
		<link>https://www.hashcollisions.com/2011/06/can-bcrypts-computational-expense-be-reduced-on-the-server-side/comment-page-1/#comment-1779</link>

		<dc:creator><![CDATA[Alan Chandler]]></dc:creator>
		<pubDate>Sun, 03 Mar 2013 17:26:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.hashcollisions.com/?p=22#comment-1779</guid>

					<description><![CDATA[I came across this web site whilst researching using bcrypt for a project I am involved with.  I was going to comment that getting the client to do the hashing effectively means that the hash is the password, and you&#039;ve got that stored in plaintext in your database - not so secure. But I see others got there before me.

But, your main thought,  make the client pay something to make use of the servers bcrypt function made me think of an issue I was pondering a couple of years ago - how do you make a javascript based chat client talk across the open internet and ensure privacy.  Unless the key is generated in the client, it will be seen when the source of the client is loaded on the initial web page.

I then researched and finally implemented something in which I got the client to compute an Asymmetric Key Pair, pass the Public Key to the server, who then encrypted a des key with it and passed it back to the client, who then encrypted his messages with it.  The REAL problem in all of this was getting the client (browser) to computer the key pair - it was expensive and needed a special implementation technique (see http://www.chandlerfamily.org.uk/2010/06/the-making-of-mbchat-v3-part-1-introducing-non-structured-programming/)

What if you implement something like this

ACCOUNT CREATION
1) Client calculates Asymmetric key pair and sends public key to server
2) Server stores public key against that client&#039;s account and generates a random des key which it encypts with the public key of the client
3) Client decrypts des key with his private key of the pair and uses the des key to symetrically encrypt password to go back to server for storage
4) Server bcrypts this password and adds it to the database.

USER LOGIN
1) Client creates a (MUST BE DIFFERENT) key pair and sends public key to server along with username
2) Server checks public key received IS NOT THE SAME AS BEFORE, or TOO MANY ATTEMPTS are being made too fast -it marks that it will ultimately reject the password
3) If the key is different, this gets stored, along with time of last access
4) Server generates random des key, encrypts with public key (even a repeated one) and sends back to client
5)Client decrypts with his private key and then encrypts his password with des key and sends back to server.
6) if server finds previous public key was not a fresh one, or too many requests are coming, it says the passwords don&#039;t compare without even computing the bcrypt.
7) Otherwise it does the bcrypt and compare and returns the result of that comparison.]]></description>
			<content:encoded><![CDATA[<p>I came across this web site whilst researching using bcrypt for a project I am involved with.  I was going to comment that getting the client to do the hashing effectively means that the hash is the password, and you&#8217;ve got that stored in plaintext in your database &#8211; not so secure. But I see others got there before me.</p>
<p>But, your main thought,  make the client pay something to make use of the servers bcrypt function made me think of an issue I was pondering a couple of years ago &#8211; how do you make a javascript based chat client talk across the open internet and ensure privacy.  Unless the key is generated in the client, it will be seen when the source of the client is loaded on the initial web page.</p>
<p>I then researched and finally implemented something in which I got the client to compute an Asymmetric Key Pair, pass the Public Key to the server, who then encrypted a des key with it and passed it back to the client, who then encrypted his messages with it.  The REAL problem in all of this was getting the client (browser) to computer the key pair &#8211; it was expensive and needed a special implementation technique (see <a href="http://www.chandlerfamily.org.uk/2010/06/the-making-of-mbchat-v3-part-1-introducing-non-structured-programming/" rel="nofollow ugc">http://www.chandlerfamily.org.uk/2010/06/the-making-of-mbchat-v3-part-1-introducing-non-structured-programming/</a>)</p>
<p>What if you implement something like this</p>
<p>ACCOUNT CREATION<br />
1) Client calculates Asymmetric key pair and sends public key to server<br />
2) Server stores public key against that client&#8217;s account and generates a random des key which it encypts with the public key of the client<br />
3) Client decrypts des key with his private key of the pair and uses the des key to symetrically encrypt password to go back to server for storage<br />
4) Server bcrypts this password and adds it to the database.</p>
<p>USER LOGIN<br />
1) Client creates a (MUST BE DIFFERENT) key pair and sends public key to server along with username<br />
2) Server checks public key received IS NOT THE SAME AS BEFORE, or TOO MANY ATTEMPTS are being made too fast -it marks that it will ultimately reject the password<br />
3) If the key is different, this gets stored, along with time of last access<br />
4) Server generates random des key, encrypts with public key (even a repeated one) and sends back to client<br />
5)Client decrypts with his private key and then encrypts his password with des key and sends back to server.<br />
6) if server finds previous public key was not a fresh one, or too many requests are coming, it says the passwords don&#8217;t compare without even computing the bcrypt.<br />
7) Otherwise it does the bcrypt and compare and returns the result of that comparison.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Skyborne		</title>
		<link>https://www.hashcollisions.com/2011/06/can-bcrypts-computational-expense-be-reduced-on-the-server-side/comment-page-1/#comment-1390</link>

		<dc:creator><![CDATA[Skyborne]]></dc:creator>
		<pubDate>Mon, 13 Aug 2012 13:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.hashcollisions.com/?p=22#comment-1390</guid>

					<description><![CDATA[Hi there, found your article looking for attacks on bcrypt (found nothing yet) but in the wake of the Blizzard hack:

If you have the luxury of running native code on the client, then I think the best way would be to run a modified SRP: instead of deriving x=sha1(salt + sha1(username + &quot;:&quot; + password)), insert your expensive hash of choice there.  Such as x=sha256(pbkdf2(hmac_sha256, username + &quot;:&quot; + password, salt, iters)).

Then the verifier (g^x % N stored on the server) is expensive for the attacker to try brute-forcing due to the cost of x, while it doesn&#039;t consume server CPU at authentication time because it was precomputed.  (Of course it consumes client CPU as it has to derive x from the given password.)

But if you&#039;re writing a web app instead, I don&#039;t know of any reliable JS SRP implementations, and doing crypto in JS is rather slow.  I can bcrypt with 09 work on a virtual machine in under 100 ms, while doing the same in JS is 300ms (chrome 22) to 1100ms (ie9) on the bare metal.  If anyone shows up using IE8, ouch.  And that doesn&#039;t even get into mobile devices.]]></description>
			<content:encoded><![CDATA[<p>Hi there, found your article looking for attacks on bcrypt (found nothing yet) but in the wake of the Blizzard hack:</p>
<p>If you have the luxury of running native code on the client, then I think the best way would be to run a modified SRP: instead of deriving x=sha1(salt + sha1(username + &#8220;:&#8221; + password)), insert your expensive hash of choice there.  Such as x=sha256(pbkdf2(hmac_sha256, username + &#8220;:&#8221; + password, salt, iters)).</p>
<p>Then the verifier (g^x % N stored on the server) is expensive for the attacker to try brute-forcing due to the cost of x, while it doesn&#8217;t consume server CPU at authentication time because it was precomputed.  (Of course it consumes client CPU as it has to derive x from the given password.)</p>
<p>But if you&#8217;re writing a web app instead, I don&#8217;t know of any reliable JS SRP implementations, and doing crypto in JS is rather slow.  I can bcrypt with 09 work on a virtual machine in under 100 ms, while doing the same in JS is 300ms (chrome 22) to 1100ms (ie9) on the bare metal.  If anyone shows up using IE8, ouch.  And that doesn&#8217;t even get into mobile devices.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andres		</title>
		<link>https://www.hashcollisions.com/2011/06/can-bcrypts-computational-expense-be-reduced-on-the-server-side/comment-page-1/#comment-537</link>

		<dc:creator><![CDATA[Andres]]></dc:creator>
		<pubDate>Tue, 28 Jun 2011 18:47:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.hashcollisions.com/?p=22#comment-537</guid>

					<description><![CDATA[Robin,

Yes, if an attacker obtained the password database, they could use the password hashes to log in with any particular user&#039;s account.  They wouldn&#039;t need to know that user&#039;s plaintext password.

Like you, I&#039;d also thought about storing a second-level hash (a hash of the bcrypt hash).  However, I didn&#039;t mention it because I don&#039;t currently understand the complexity of hash functions well enough.  There are at least two issues that come to mind regarding the complexity of the second-level hash function:

1) If we used MD5 or SHA-1, would this cause the same problem Coda Hale warned against?  A bcrypt hash would likely be longer and more complex than a typical user-defined 6 character password.  Could a cracker feasibly produce the MD5 hashes for all the strings as long as a bcrypt hash?  (I don&#039;t know how much slower MD5 gets with each additional input character, or how much slower it gets to produce MD5 hashes for all the strings of a given length.)

2) If we used bcrypt itself as a 2nd-level hash, wouldn&#039;t that cause the same problem I was trying to avoid (running bcrypt at log-in time)?  Maybe this 2nd-level bcrypt hash could be configured to be less computationally expensive that the 1st-level hash (the one used on a user&#039;s plaintext password).  Thus it&#039;d be moderately inexpensive to verify a user&#039;s password, but more expensive to crack it (since the input string the password cracker is trying to find is a bcrypt hash, not a traditional, weak user-selected password).  Like you said, I need a security expert (or several) to look into this.

Thank you for your feedback.]]></description>
			<content:encoded><![CDATA[<p>Robin,</p>
<p>Yes, if an attacker obtained the password database, they could use the password hashes to log in with any particular user&#8217;s account.  They wouldn&#8217;t need to know that user&#8217;s plaintext password.</p>
<p>Like you, I&#8217;d also thought about storing a second-level hash (a hash of the bcrypt hash).  However, I didn&#8217;t mention it because I don&#8217;t currently understand the complexity of hash functions well enough.  There are at least two issues that come to mind regarding the complexity of the second-level hash function:</p>
<p>1) If we used MD5 or SHA-1, would this cause the same problem Coda Hale warned against?  A bcrypt hash would likely be longer and more complex than a typical user-defined 6 character password.  Could a cracker feasibly produce the MD5 hashes for all the strings as long as a bcrypt hash?  (I don&#8217;t know how much slower MD5 gets with each additional input character, or how much slower it gets to produce MD5 hashes for all the strings of a given length.)</p>
<p>2) If we used bcrypt itself as a 2nd-level hash, wouldn&#8217;t that cause the same problem I was trying to avoid (running bcrypt at log-in time)?  Maybe this 2nd-level bcrypt hash could be configured to be less computationally expensive that the 1st-level hash (the one used on a user&#8217;s plaintext password).  Thus it&#8217;d be moderately inexpensive to verify a user&#8217;s password, but more expensive to crack it (since the input string the password cracker is trying to find is a bcrypt hash, not a traditional, weak user-selected password).  Like you said, I need a security expert (or several) to look into this.</p>
<p>Thank you for your feedback.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andres		</title>
		<link>https://www.hashcollisions.com/2011/06/can-bcrypts-computational-expense-be-reduced-on-the-server-side/comment-page-1/#comment-536</link>

		<dc:creator><![CDATA[Andres]]></dc:creator>
		<pubDate>Tue, 28 Jun 2011 17:22:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.hashcollisions.com/?p=22#comment-536</guid>

					<description><![CDATA[This article is being disccussed on Hacker News.  Be sure to check it out:

http://news.ycombinator.com/item?id=2705915]]></description>
			<content:encoded><![CDATA[<p>This article is being disccussed on Hacker News.  Be sure to check it out:</p>
<p><a href="http://news.ycombinator.com/item?id=2705915" rel="nofollow ugc">http://news.ycombinator.com/item?id=2705915</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Robin Message		</title>
		<link>https://www.hashcollisions.com/2011/06/can-bcrypts-computational-expense-be-reduced-on-the-server-side/comment-page-1/#comment-535</link>

		<dc:creator><![CDATA[Robin Message]]></dc:creator>
		<pubDate>Tue, 28 Jun 2011 16:24:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.hashcollisions.com/?p=22#comment-535</guid>

					<description><![CDATA[&#062; Account Log-in
&#062; 6 The browser submits Turing’s username and bcrypted hash to SecureR.
&#062; 7 SecureR directly compares the hash submitted by Turing with the one stored in his user record. If they match, account access is granted.

So, suppose I&#039;ve stolen the password database of SecureR. Unfortunately, I can&#039;t recover the password of the user. However, I only need the hash of it (which is stored in the database) to log in, so I don&#039;t need to recover the password anyway.

This does protect against exposing the user&#039;s password, so it&#039;s not a total waste. An additional wrinkle:

You could store the hash of the bcrypted password in the database. The browser would submit the bcrypted password in 6, and the server would hash it in 7 before checking it. This makes recovering the password infeasible but logging in is cheap for the server, and the input to the hash function has high entropy, so it will still be hard to crack. At this point though, you need a security expert to evaluate it.]]></description>
			<content:encoded><![CDATA[<p>&gt; Account Log-in<br />
&gt; 6 The browser submits Turing’s username and bcrypted hash to SecureR.<br />
&gt; 7 SecureR directly compares the hash submitted by Turing with the one stored in his user record. If they match, account access is granted.</p>
<p>So, suppose I&#8217;ve stolen the password database of SecureR. Unfortunately, I can&#8217;t recover the password of the user. However, I only need the hash of it (which is stored in the database) to log in, so I don&#8217;t need to recover the password anyway.</p>
<p>This does protect against exposing the user&#8217;s password, so it&#8217;s not a total waste. An additional wrinkle:</p>
<p>You could store the hash of the bcrypted password in the database. The browser would submit the bcrypted password in 6, and the server would hash it in 7 before checking it. This makes recovering the password infeasible but logging in is cheap for the server, and the input to the hash function has high entropy, so it will still be hard to crack. At this point though, you need a security expert to evaluate it.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
