<?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, Nagios, XML, FileMaker, BlackBerry, Arduino</description>
	<lastBuildDate>Tue, 27 Mar 2012 10:06:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>{SSHA} Salted SHA1 with PHP</title>
		<link>http://ten-fingers-and-a-brain.com/2009/08/ssha-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=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[encryption]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[PHP]]></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: 1TweetI 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:]]></description>
			<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2009/08/ssha-php/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="{SSHA} Salted SHA1 with PHP" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2009/08/ssha-php/">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: 1</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2009%2F08%2Fssha-php%2F&amp;via=10fnab&amp;text=%7BSSHA%7D%20Salted%20SHA1%20with%20PHP&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2009/08/ssha-php/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><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; title: ; notranslate">&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/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=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[blurts]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></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/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=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 "CLI has stopped working" 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[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2008/02/php-cli-has-stopped-working-on-windows-vista/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="Getting XAMPP&#039;s PHP CLI to work on Vista" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2008/02/php-cli-has-stopped-working-on-windows-vista/">This is a quicky: If you have Windows Vista and XAMPP and your "CLI has stopped working" 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 older version was previously installed on your system. – I know this seems weird, but it works. If you want a longer explanation, read Tengku Zahasman's article on the same subject, with the comments. (I found the article using Google.)</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2008%2F02%2Fphp-cli-has-stopped-working-on-windows-vista%2F&amp;via=10fnab&amp;text=Getting%20XAMPP%26%238217%3Bs%20PHP%20CLI%20to%20work%20on%20Vista&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2008/02/php-cli-has-stopped-working-on-windows-vista/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><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>

