<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TommyBlue.it &#187; CakePHP</title>
	<atom:link href="http://www.tommyblue.it/tag/cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tommyblue.it</link>
	<description>Bombardare per la pace è un po' come trombare per la verginità...</description>
	<lastBuildDate>Tue, 24 Jan 2012 09:34:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CakePHP authentication and password hashing</title>
		<link>http://www.tommyblue.it/2008/05/15/cakephp-authentication-and-password-hashing/</link>
		<comments>http://www.tommyblue.it/2008/05/15/cakephp-authentication-and-password-hashing/#comments</comments>
		<pubDate>Wed, 14 May 2008 23:50:15 +0000</pubDate>
		<dc:creator>TommyBlue</dc:creator>
				<category><![CDATA[Informatica]]></category>
		<category><![CDATA[Software Libero]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.tommyblue.it/?p=147</guid>
		<description><![CDATA[I had some problem with the authentication guide in the CakePHP book so i made some modifications to the wiki and i report here my problem. If you create the user table as suggested in the guide you must know that the password used by CakePHP, before the standard hash SHA1 are encrypted with the [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.cakephp.org'><img src="http://www.tommyblue.it/wp-content/uploads/2008/05/schermata.png" alt="" title="CakePHP" width="171" height="168" class="alignleft size-full wp-image-148" /></a> I had some problem with the <a href="http://book.cakephp.org/view/172/authentication">authentication guide</a> in the <a href="http://book.cakephp.org">CakePHP book</a> so i made some modifications to the wiki and i report here my problem.</p>
<p>If you create the user table as suggested in the guide you must know that the password used by CakePHP, <strong>before</strong> the standard hash <strong>SHA1</strong> are encrypted with the <strong>seed</strong> saved in <strong>app/config/core.php</strong> in this way:<br />
<em>hashpwd = SHA1(seed+plain_text_password)</em>.</p>
<p>I didn&#8217;t know that and i saved my first user with:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">INSERT INTO users (username, password) VALUES ('pippo', SHA1('pippo'));</div></div>
<p>And the login failed and failed&#8230;<br />
So i spent a couple of hours trying to find an inexistent error in my code :(<br />
At the end, after a full debug, i found it: the select query used a password hash different from mine, and the secret was revealed :D</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tommyblue.it/2008/05/15/cakephp-authentication-and-password-hashing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

