<?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>Ten Fingers And A Brain &#187; PHP</title>
	<atom:link href="http://ten-fingers-and-a-brain.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://ten-fingers-and-a-brain.com</link>
	<description>Martin Lormes on Wordpress, PHP, XML, FileMaker</description>
	<lastBuildDate>Fri, 04 Jun 2010 11:04:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>{SSHA} Salted SHA1 with PHP</title>
		<link>http://ten-fingers-and-a-brain.com/2009/08/ssha-php/</link>
		<comments>http://ten-fingers-and-a-brain.com/2009/08/ssha-php/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 19:36:25 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[OOP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[openLDAP]]></category>
		<category><![CDATA[passwd]]></category>
		<category><![CDATA[sha1]]></category>
		<category><![CDATA[ssha]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/2009/08/ssha-php/</guid>
		<description><![CDATA[I was in need of a PHP class to encrypt hash and verify passwords using salted sha1 hashes. Here it is, quick but not too dirty:
&#60;?php

class SSHA
{

  public static function newSalt()
  {
    return chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255));
  }

  public static function hash($pass,$salt)
  {
    return '{SSHA}'.base64_encode(sha1($pass.$salt,true).$salt);
  }

 [...]]]></description>
			<content:encoded><![CDATA[<p>I was in need of a PHP class to <del datetime="2009-08-02T23:39:58+00:00">encrypt</del> hash and verify passwords using salted sha1 hashes. Here it is, quick but not too dirty:</p>
<pre class="brush: php;">&lt;?php

class SSHA
{

  public static function newSalt()
  {
    return chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255));
  }

  public static function hash($pass,$salt)
  {
    return '{SSHA}'.base64_encode(sha1($pass.$salt,true).$salt);
  }

  public static function getSalt($hash)
  {
    return substr(base64_decode(substr($hash,-32)),-4);
  }

  public static function newHash($pass)
  {
    return self::hash($pass,self::newSalt());
  }

  public static function verifyPassword($pass,$hash)
  {
    return $hash == self::hash($pass,self::getSalt($hash));
  }

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2009/08/ssha-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Negative Memory Consumption</title>
		<link>http://ten-fingers-and-a-brain.com/2008/07/negative-memory-consumption/</link>
		<comments>http://ten-fingers-and-a-brain.com/2008/07/negative-memory-consumption/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 14:54:59 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[blurts]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/2008/07/negative-memory-consumption/</guid>
		<description><![CDATA[ yeah, right.
]]></description>
			<content:encoded><![CDATA[<p><img src='http://ten-fingers-and-a-brain.com/wp-content/uploads/2008/07/minus85kb.gif' alt='- 85.3 KB' /> yeah, right.</p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2008/07/negative-memory-consumption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting XAMPP&#8217;s PHP CLI to work on Vista</title>
		<link>http://ten-fingers-and-a-brain.com/2008/02/php-cli-has-stopped-working-on-windows-vista/</link>
		<comments>http://ten-fingers-and-a-brain.com/2008/02/php-cli-has-stopped-working-on-windows-vista/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 10:29:42 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[php cli]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/2008/02/php-cli-has-stopped-working-on-windows-vista/</guid>
		<description><![CDATA[This is a quicky: If you have Windows Vista and XAMPP and your &#8220;CLI has stopped working&#8221; you need to download the PHP binaries (Windows Binaries, zip package) from php.net and replace the php_mysqli.dll in C:\xampp\php\ext with the version you just downloaded. Downloading the latest version of PHP should work just fine, even if an [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quicky: If you have Windows Vista and XAMPP and your &#8220;CLI has stopped working&#8221; you need to <a href="http://www.php.net/downloads.php">download the PHP binaries (Windows Binaries, zip package) from php.net</a> and replace the <code>php_mysql<strong>i</strong>.dll</code> in <code>C:\xampp\php\ext</code> with the version you just downloaded. Downloading the latest version of PHP should work just fine, even if an older version was previously installed on your system. – I know this seems weird, but it works. If you want a longer explanation, read <a href="http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-vista.html">Tengku Zahasman&#8217;s article on the same subject, with the comments</a>. (I found the article using Google.)</p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2008/02/php-cli-has-stopped-working-on-windows-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
