<?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: Building Browsergames: Securing our hashes (PHP)</title>
	<atom:link href="http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/</link>
	<description>Ever wanted to build a browsergame?</description>
	<lastBuildDate>Wed, 30 Nov 2011 19:42:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Valerio De Camillis</title>
		<link>http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/comment-page-1/#comment-907</link>
		<dc:creator>Valerio De Camillis</dc:creator>
		<pubDate>Wed, 24 Aug 2011 21:44:49 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=84#comment-907</guid>
		<description>Well, this post is 2 years old now, but still for those reading it now: this is not the proper way of storing salted hashes.&lt;br&gt;&lt;br&gt;The real purpose of salt is to render hashes of the same password different from each other so that if two users have the same password their hashed values would still look different.&lt;br&gt;&lt;br&gt;A proper implementation would add a random salt generated on the fly for each user, and store that value in a &#039;salt&#039; column in the db.&lt;br&gt;&lt;br&gt;Then you can compute the proper hash fetching the salt associated with the username, then joining it with the password the user typed in.&lt;br&gt;&lt;br&gt;Disqus is too laggy today for me to write proper code, but i doubt anyone will be reading this anyway.</description>
		<content:encoded><![CDATA[<p>Well, this post is 2 years old now, but still for those reading it now: this is not the proper way of storing salted hashes.</p>
<p>The real purpose of salt is to render hashes of the same password different from each other so that if two users have the same password their hashed values would still look different.</p>
<p>A proper implementation would add a random salt generated on the fly for each user, and store that value in a &#39;salt&#39; column in the db.</p>
<p>Then you can compute the proper hash fetching the salt associated with the username, then joining it with the password the user typed in.</p>
<p>Disqus is too laggy today for me to write proper code, but i doubt anyone will be reading this anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: binni</title>
		<link>http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/comment-page-1/#comment-521</link>
		<dc:creator>binni</dc:creator>
		<pubDate>Thu, 15 Oct 2009 07:34:46 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=84#comment-521</guid>
		<description>I meailing this to my friend he has got great interest in this.&lt;br&gt;&lt;br&gt;Have a nice day&lt;br&gt;paul&lt;br&gt;______________________________________________&lt;br&gt;&lt;a href=&quot;http://www.chaperonealert.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Medical Alarm&lt;/a&gt; &#124; &lt;a &lt;a href=&quot;http://href=%22http://www.SMARTSOURCENEWS.com&quot; rel=&quot;nofollow&quot;&gt;href=&quot;http://www.SMARTSOURCENEWS.com&lt;/a&gt; &quot; target=&quot;_blank&quot;&gt;pass a drug test&lt;/a&gt; &#124; &lt;a &lt;a href=&quot;http://href=%22http://www.PASS-ALL-DRUG-TEST.com&quot; rel=&quot;nofollow&quot;&gt;href=&quot;http://www.PASS-ALL-DRUG-TEST.com&lt;/a&gt; &quot; target=&quot;_blank&quot;&gt;pass marijuana drug test&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I meailing this to my friend he has got great interest in this.</p>
<p>Have a nice day<br />paul<br />______________________________________________<br /><a href="http://www.chaperonealert.com/" target="_blank" rel="nofollow">Medical Alarm</a> | &lt;a <a href="http://href=%22http://www.SMARTSOURCENEWS.com" rel="nofollow">href=&#8221;http://www.SMARTSOURCENEWS.com</a> &#8221; target=&#8221;_blank&#8221;&gt;pass a drug test | &lt;a <a href="http://href=%22http://www.PASS-ALL-DRUG-TEST.com" rel="nofollow">href=&#8221;http://www.PASS-ALL-DRUG-TEST.com</a> &#8221; target=&#8221;_blank&#8221;&gt;pass marijuana drug test</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: max191</title>
		<link>http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/comment-page-1/#comment-484</link>
		<dc:creator>max191</dc:creator>
		<pubDate>Mon, 05 Oct 2009 08:08:27 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=84#comment-484</guid>
		<description>I would just say one thing to you and that is, â€œFANTASTICâ€!! Keep it up and wish to get more details from your blog.&lt;br&gt;regards&lt;br&gt;&lt;a rel=&quot;dofollow&quot; href=&quot;http://www.charcoalgrillsite.com&quot; rel=&quot;nofollow&quot;&gt;charcoal grill&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I would just say one thing to you and that is, â€œFANTASTICâ€!! Keep it up and wish to get more details from your blog.<br />regards<br /><a rel="dofollow" href="http://www.charcoalgrillsite.com" rel="nofollow">charcoal grill</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrLollige</title>
		<link>http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/comment-page-1/#comment-369</link>
		<dc:creator>MrLollige</dc:creator>
		<pubDate>Sat, 14 Mar 2009 18:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=84#comment-369</guid>
		<description>Ah ok :).&lt;br&gt;Anyway, my salt (which I made before I read this thanks to the user comments on other pages) is short, and I probably do not need it anywhere else than on the login and register page. &lt;br&gt;Thanks for your reply!</description>
		<content:encoded><![CDATA[<p>Ah ok <img src='http://buildingbrowsergames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />Anyway, my salt (which I made before I read this thanks to the user comments on other pages) is short, and I probably do not need it anywhere else than on the login and register page. <br />Thanks for your reply!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/comment-page-1/#comment-362</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Sat, 14 Mar 2009 17:12:13 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=84#comment-362</guid>
		<description>The benefits of turning it into a configuration value aren&#039;t so much in&lt;br&gt;securing it, as they are in not repeating it everywhere - if your salt is&lt;br&gt;&#039;thequickbrownfoxjumpedoverthelazydog&#039;, do you really want to type that&lt;br&gt;everytime you need it?</description>
		<content:encoded><![CDATA[<p>The benefits of turning it into a configuration value aren&#39;t so much in<br />securing it, as they are in not repeating it everywhere &#8211; if your salt is<br />&#39;thequickbrownfoxjumpedoverthelazydog&#39;, do you really want to type that<br />everytime you need it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrLollige</title>
		<link>http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/comment-page-1/#comment-361</link>
		<dc:creator>MrLollige</dc:creator>
		<pubDate>Sat, 14 Mar 2009 16:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=84#comment-361</guid>
		<description>you could(and probably should) turn the salt into a configuration parameter&lt;br&gt;&lt;br&gt;Why? I mean, if I change the salt value (if someone figured it and modified his dictionary to it), noone would be able to login any more....</description>
		<content:encoded><![CDATA[<p>you could(and probably should) turn the salt into a configuration parameter</p>
<p>Why? I mean, if I change the salt value (if someone figured it and modified his dictionary to it), noone would be able to login any more&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hepner</title>
		<link>http://buildingbrowsergames.com/2008/07/15/securing-our-hashes-php/comment-page-1/#comment-181</link>
		<dc:creator>Chris Hepner</dc:creator>
		<pubDate>Sun, 30 Nov 2008 23:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=84#comment-181</guid>
		<description>It doesn&#039;t matter much, but it isn&#039;t necessary to nest the md5() function within mysql_real_escape_string() as you will never have to escape a hexadecimal string. &lt;br&gt;&lt;br&gt;While it usually works regardless, HTTP/1.1 requires you to use an absolute URL in header redirects. Example from php manual below:&lt;br&gt;&lt;br&gt;/* Redirect to a different page in the current directory that was requested */&lt;br&gt;$host  = $_SERVER[&#039;HTTP_HOST&#039;];&lt;br&gt;$uri   = rtrim(dirname($_SERVER[&#039;PHP_SELF&#039;]), &#039;/\&#039;);&lt;br&gt;$extra = &#039;mypage.php&#039;;&lt;br&gt;header(&quot;Location: &lt;a href=&quot;http://%24host%24uri/%24extra%22%29;&quot; rel=&quot;nofollow&quot;&gt;http://$host$uri/$extra&quot;);&lt;/a&gt;&lt;br&gt;exit();</description>
		<content:encoded><![CDATA[<p>It doesn&#39;t matter much, but it isn&#39;t necessary to nest the md5() function within mysql_real_escape_string() as you will never have to escape a hexadecimal string. </p>
<p>While it usually works regardless, HTTP/1.1 requires you to use an absolute URL in header redirects. Example from php manual below:</p>
<p>/* Redirect to a different page in the current directory that was requested */<br />$host  = $_SERVER[&#39;HTTP_HOST&#39;];<br />$uri   = rtrim(dirname($_SERVER[&#39;PHP_SELF&#39;]), &#39;/\&#39;);<br />$extra = &#39;mypage.php&#39;;<br />header(&#8221;Location: <a href="http://%24host%24uri/%24extra%22%29;" rel="nofollow"></a><a href="http://$host$uri/$extra" rel="nofollow">http://$host$uri/$extra</a>&#8220;);<br />exit();</p>
]]></content:encoded>
	</item>
</channel>
</rss>

