<?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:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Preparing a secure login form with PHP &amp; JavaScript</title>
	<atom:link href="http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/</link>
	<description>web * programming * the higher end</description>
	<lastBuildDate>Thu, 18 Jun 2009 23:38:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Thorix &#187; Sicheres Login mit PHP und Javascript</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-111</link>
		<dc:creator>Thorix &#187; Sicheres Login mit PHP und Javascript</dc:creator>
		<pubDate>Fri, 16 Jan 2009 22:34:51 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-111</guid>
		<description>[...] â€šPreparing a secure login form with PHP &amp;Â JavaScriptâ€˜ by Kumar Rahul (observances): Beschreibt die Clientseitige VerschlÃ¼sselung des Passwortes mit MD5 (SHA-1 wÃ¤re auch mÃ¶glich), â€žgesalzenâ€œ mit einem Timestamp aus PHP::time() [...]</description>
		<content:encoded><![CDATA[<p>[...] â€šPreparing a secure login form with PHP &amp;Â JavaScriptâ€˜ by Kumar Rahul (observances): Beschreibt die Clientseitige VerschlÃ¼sselung des Passwortes mit MD5 (SHA-1 wÃ¤re auch mÃ¶glich), â€žgesalzenâ€œ mit einem Timestamp aus PHP::time() [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krahulg</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-91</link>
		<dc:creator>krahulg</dc:creator>
		<pubDate>Tue, 26 Aug 2008 04:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-91</guid>
		<description>&lt;strong&gt;@paul&lt;/strong&gt;: I had put this up as an alternative to simple login systems, the  based ones. This definitely is not a replacement for HTTPS. And the setup required to really do a man-in-the-middle against this is fairly demanding and simple listening won&#039;t do.
And thanks for stopping by, its very lonely out here.</description>
		<content:encoded><![CDATA[<p><strong>@paul</strong>: I had put this up as an alternative to simple login systems, the  based ones. This definitely is not a replacement for HTTPS. And the setup required to really do a man-in-the-middle against this is fairly demanding and simple listening won&#8217;t do.<br />
And thanks for stopping by, its very lonely out here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: paul</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-90</link>
		<dc:creator>paul</dc:creator>
		<pubDate>Tue, 26 Aug 2008 02:54:17 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-90</guid>
		<description>I really like the idea. However one would have to combine it with HTTPS (preferably with a certificate signed by a well-known and trusted entity) to prevent a possible man-in-the-middle attack.

Otherwise the man-in-the-middle could just remove the java-script code and then do the hashing before sending the request on to the real server.

But then again, when using HTTPS with a trusted certificate, is there really any need to send a hashcode instead of the verbatim-but-now-SSL-encrypted password?

Hmmm...

And I see another possible problem: what about overly-restrictive content-filters that strip java-script? A page crippled by such filters would still send the password in cleartext. The server could of course recognize such a case by inspecting the &quot;password&quot; and &quot;phash&quot; fields, but the password would still be on the wire in cleartext.</description>
		<content:encoded><![CDATA[<p>I really like the idea. However one would have to combine it with HTTPS (preferably with a certificate signed by a well-known and trusted entity) to prevent a possible man-in-the-middle attack.</p>
<p>Otherwise the man-in-the-middle could just remove the java-script code and then do the hashing before sending the request on to the real server.</p>
<p>But then again, when using HTTPS with a trusted certificate, is there really any need to send a hashcode instead of the verbatim-but-now-SSL-encrypted password?</p>
<p>Hmmm&#8230;</p>
<p>And I see another possible problem: what about overly-restrictive content-filters that strip java-script? A page crippled by such filters would still send the password in cleartext. The server could of course recognize such a case by inspecting the &#8220;password&#8221; and &#8220;phash&#8221; fields, but the password would still be on the wire in cleartext.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vijay</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-37</link>
		<dc:creator>vijay</dc:creator>
		<pubDate>Mon, 28 Apr 2008 09:29:38 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-37</guid>
		<description>Thanks Rahul,
You are correct and I am such a jerk ! :(</description>
		<content:encoded><![CDATA[<p>Thanks Rahul,<br />
You are correct and I am such a jerk ! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krahulg</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-36</link>
		<dc:creator>krahulg</dc:creator>
		<pubDate>Mon, 28 Apr 2008 09:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-36</guid>
		<description>Hi vijay,
you can always send the hashing timestamp greater than the current time, but remember that you also have to hash the password with the timestamp. for the attack to succeed you need to know the password and hash it correctly. if you know the password already, you would rather use the login form and then nothing can stop you. am i right in getting your point here??</description>
		<content:encoded><![CDATA[<p>Hi vijay,<br />
you can always send the hashing timestamp greater than the current time, but remember that you also have to hash the password with the timestamp. for the attack to succeed you need to know the password and hash it correctly. if you know the password already, you would rather use the login form and then nothing can stop you. am i right in getting your point here??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vijay</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-35</link>
		<dc:creator>vijay</dc:creator>
		<pubDate>Mon, 28 Apr 2008 08:56:27 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-35</guid>
		<description>Hi,

Thanks again for the info shared.

I fell a &quot;BIG&quot; thing is missing here.
What if the sniffer  sends $hts greater than the current time. he will be successful in logging into the system.

may be u have that in ur mind but dint tell it out..
&quot; system described here lacks certain things which are very obvious&quot; 

Thanks for letting me know .. if I got it completely wrong !</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks again for the info shared.</p>
<p>I fell a &#8220;BIG&#8221; thing is missing here.<br />
What if the sniffer  sends $hts greater than the current time. he will be successful in logging into the system.</p>
<p>may be u have that in ur mind but dint tell it out..<br />
&#8221; system described here lacks certain things which are very obvious&#8221; </p>
<p>Thanks for letting me know .. if I got it completely wrong !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel in Brazil » Blog Archive &#187; A not-that-unsecure login form</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-31</link>
		<dc:creator>Gabriel in Brazil » Blog Archive &#187; A not-that-unsecure login form</dc:creator>
		<pubDate>Tue, 11 Mar 2008 12:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-31</guid>
		<description>[...] No Translations   This article discusses a way for HTML login forms not to transmit plain-text passwords over the internet when SSL or https are too complex and still in your TODO list. This is an enhancement of this solution. [...]</description>
		<content:encoded><![CDATA[<p>[...] No Translations   This article discusses a way for HTML login forms not to transmit plain-text passwords over the internet when SSL or https are too complex and still in your TODO list. This is an enhancement of this solution. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krahulg</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-29</link>
		<dc:creator>krahulg</dc:creator>
		<pubDate>Sat, 23 Feb 2008 06:34:12 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-29</guid>
		<description>Hi Gabriel, and am really happy to see you taking attention and even going as far as adopting it.
About security, well, I have given up on the idea of a future-proof security device or method. The best I can do is make a parrot learn vowels and pass messages through it. How would you know which parrot to trap?? &quot;Don&#039;t get anybody curious&quot; might be the way to it, but I have other things to do right now. :).</description>
		<content:encoded><![CDATA[<p>Hi Gabriel, and am really happy to see you taking attention and even going as far as adopting it.<br />
About security, well, I have given up on the idea of a future-proof security device or method. The best I can do is make a parrot learn vowels and pass messages through it. How would you know which parrot to trap?? &#8220;Don&#8217;t get anybody curious&#8221; might be the way to it, but I have other things to do right now. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-28</link>
		<dc:creator>Gabriel</dc:creator>
		<pubDate>Fri, 22 Feb 2008 21:06:52 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-28</guid>
		<description>Ops, I did not thank you for the idea! I just implemented it and feel a deep relief not to sent plain text passwords anymore.
Thanks (:</description>
		<content:encoded><![CDATA[<p>Ops, I did not thank you for the idea! I just implemented it and feel a deep relief not to sent plain text passwords anymore.<br />
Thanks (:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel</title>
		<link>http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-27</link>
		<dc:creator>Gabriel</dc:creator>
		<pubDate>Fri, 22 Feb 2008 21:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://krahulg.wordpress.com/2007/12/26/preparing-a-secure-login-form-with-php-javascript/#comment-27</guid>
		<description>I resolved the hashed password issue. My database actually stores MD5&#039;ed passwords. Here is how I did:
The javascript calculates the password&#039;s MD5. Then it concatenates the result with the timestamp and calculates the MD5 again. The result is sent to the server.
The server reads the MD5&#039;ed password from the database, concatenates the timestamp and calculates the MD5.
Now compare the received hash with the calculated one and here you are!

I guess all this MD5 thing is a simple way not to send plain text passwords over the web, but it still is quite vulnerable. A clever eavesdrop reading the POST request can figure out how all this is done and, later, try to obtain the hashed password with a bruteforce loop:

1. a = string to test
2. a += timestamp given in the POST
3. b = MD5(a)
4. if (b == password given in the POST) { bingo! }
5. goto 1

I guess some days or weeks would be enough to break the password, probably less with a dictionary-based loop first.</description>
		<content:encoded><![CDATA[<p>I resolved the hashed password issue. My database actually stores MD5&#8242;ed passwords. Here is how I did:<br />
The javascript calculates the password&#8217;s MD5. Then it concatenates the result with the timestamp and calculates the MD5 again. The result is sent to the server.<br />
The server reads the MD5&#8242;ed password from the database, concatenates the timestamp and calculates the MD5.<br />
Now compare the received hash with the calculated one and here you are!</p>
<p>I guess all this MD5 thing is a simple way not to send plain text passwords over the web, but it still is quite vulnerable. A clever eavesdrop reading the POST request can figure out how all this is done and, later, try to obtain the hashed password with a bruteforce loop:</p>
<p>1. a = string to test<br />
2. a += timestamp given in the POST<br />
3. b = MD5(a)<br />
4. if (b == password given in the POST) { bingo! }<br />
5. goto 1</p>
<p>I guess some days or weeks would be enough to break the password, probably less with a dictionary-based loop first.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
