<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 23 May 2012 10:52:04 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Michael Nitschinger's Blog: Session Encryption with Lithium]]></title>
      <guid>http://www.phpdeveloper.org/news/17427</guid>
      <link>http://www.phpdeveloper.org/news/17427</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has a new post for the <a href="http://lithify.me/">Lithium framework</a> users out there - a quick tutorial about <a href="http://nitschinger.at/Session-Encryption-with-Lithium">encrypting your session information</a> with the new built in "Encrypt" strategy feature.
</p>
<blockquote>
If you check out the master branch, you can use the new Encrypt strategy to encrypt your session data automatically. This means that you can read and write session data in cleartext and they will be encrypted on the fly before getting stored (in a cookie, for example). 
</blockquote>
<p>
You'll need the <a href="http://php.net/manual/en/book.mcrypt.php">mcrypt extension</a> installed for it to work correctly, but it makes storing the encrypted version of your data more or less automatic. Just set up your Session configuration to use it as a strategy and any time you call a "read" or "write" the hard work is handled for you. For those more interests in what's "under the hood" he goes on to talk about how the strategy works, what cipher it uses by default, how to change it and the default string to use in hashing. 
</p>]]></description>
      <pubDate>Fri, 20 Jan 2012 12:09:08 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Freek Lijten's Blog: The real problem of the hash table dos attack]]></title>
      <guid>http://www.phpdeveloper.org/news/17328</guid>
      <link>http://www.phpdeveloper.org/news/17328</link>
      <description><![CDATA[<p>
In response to some of the comments being made about the hash table Denial of Service attack <a href="http://phpdeveloper.org/news/17322">recently posted</a> <i>Freek Lijten</i> has <a href="http://www.freeklijten.nl/home/2011/12/29/The-real-problem-of-the-hash-table-dos-attack">posted his thoughts</a> about the real problem with the whole situation - how it was handled by the communities involved.
</p>
<blockquote>
Interesting they may be, but I want to address what in my opinion is the real problem: The way the communication around it was handled by different projects and the fact that the exploit could still exist at all. [...] In the presentation <a href="https://twitter.com/#!/zeri42">W&auml;lde</a> and <a href="https://twitter.com/#!/alech">Klink</a> talk about their disclosure process. The PHP project had them wait 3 weeks for a first response while this is obviously a serious matter.
</blockquote>
<p>
He argues that things like a commit message mentioning a DoS prevention fix instead of just mentioning the fix have the potential to do more harm than good. He also points out that other communities were notified of the problem (like Python) and some still haven't responded to the issue.
</p>
<blockquote>
This attack was the result of good research and it is important that it is disclosed. More importantly however is the fact that organisation got by with years of not noticing it and even worse, reacted very poor after being informed. I can't say I have a ready solution to avoid these kind of things in the future, perhaps that will prove to be an interesting discussion.
</blockquote>]]></description>
      <pubDate>Fri, 30 Dec 2011 12:53:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP.net: 5.3.7 upgrade warning]]></title>
      <guid>http://www.phpdeveloper.org/news/16752</guid>
      <link>http://www.phpdeveloper.org/news/16752</link>
      <description><![CDATA[<p>
In a quick note from the PHP.net site, they have a warning for those running PHP 5.3.7 (the most recent release) - there's a bug that's serious enough (with <a href="http://php.net/crypt">crypt</a>) to where upgrades should probably wait until 5.3.8.
</p>
<blockquote>
Due to unfortunate issues with 5.3.7 (see <a href="https://bugs.php.net/bug.php?id=55439">bug#55439</a>) users should wait with upgrading until 5.3.8 will be released (expected in few days).
</blockquote>
<p>
<a href="https://bugs.php.net/bug.php?id=55439">The issue</a> causes the crypt() function to only return the (MD5-only) salt it was given instead of the correctly hashed string. If you need to replace this immediately, you can pull the latest from <a href="http://snaps.php.net/">the snaps site</a> (or <a href="http://windows.php.net/snapshots/">binaries for Windows</a>). Keep an eye out for PHP 5.3.8 in the near future.
</p>]]></description>
      <pubDate>Mon, 22 Aug 2011 12:32:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Marcus Bointon's Blog: PHP Base-62 Encoding]]></title>
      <guid>http://www.phpdeveloper.org/news/16706</guid>
      <link>http://www.phpdeveloper.org/news/16706</link>
      <description><![CDATA[<p>
In a recent post <i>Marcus Bointon</i> looks at a hashing method that's not one as commonly used by developers as the usual <a href="http://php.net/base64_encode">base64</a> - <a href="http://marcus.bointon.com/archives/92-PHP-Base-62-encoding.html">base-62 encoding</a> that plays a bit nicer with things like URLs and emails due to the character set it allows.
</p>
<blockquote>
There's a really horrible bug (though they won't call it that!) in Apache's mod_rewrite that means that urlencoded inputs in rewrites get unescaped in their transformation to output patterns. The bug actually remains unfixed, though a workaround first appeared in Apache 2.2.12. [...] Base-62 is interesting as it can be made safe for use in URLs, DNS, email addresses and pathnames, unlike any available encoding of base-64, as it only includes [0-9A-Za-z].
</blockquote>
<p>
He originally wrote his own parser, but notes that now the <a href="http://li.php.net/manual/en/book.bc.php">BCMath</a> and <a href="http://li.php.net/manual/en/book.gmp.php">gmp</a> extensions make it much simpler, just a call to <a href="http://www.php.net/gmp_strval">gmp_strval</a> with <a href="http://www.php.net/gmp_init">gmp_init</a>. This method works, but it's still not quite all he wanted so he <a href="https://gist.github.com/1139429">created his own encoder</a> to do the job.
</p>]]></description>
      <pubDate>Thu, 11 Aug 2011 11:28:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Checking your site for malicious changes]]></title>
      <guid>http://www.phpdeveloper.org/news/16693</guid>
      <link>http://www.phpdeveloper.org/news/16693</link>
      <description><![CDATA[<p>
<i>Sameer Borate</i>, in the wake of having security issues with his site, has <a href="http://www.codediesel.com/security/checking-your-site-for-malicious-changes">posted a hint</a> you could use to help detect when something has changed in important files in your application by checking their hash.
</p>
<blockquote>
Today a couple of hours back my site got compromised. Not much changes to the code, but the .htacces was changed and some code [...] was added to the .htaccess file, which redirected the traffic coming from search engines to a malware site. It has now been removed and to prevent any such changes to the .htaccess file in the future, I've written a small php script that compares the hash (SHA1) of the two major files that usually get compromised and compare them to the one originally stored. 
</blockquote>
<p>
It's not a preventative measure by any means, but it can help you keep track of if something's changed. Several issues have popped up in the major blogging engines that allow for changes to be made directly to files. These changes result in the <a href="http://php.net/sha1_file">sha hash</a> to be different and can be used to trigger a security alert. His sample code shows a basic call to <a href="http://php.net/mail">mail</a> an alert, but it could be as complex as you'd like (possibly even logging to a database or the like).
</p>]]></description>
      <pubDate>Tue, 09 Aug 2011 10:04:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jordi Boggiano's Blog: Unpredictable hashes for humans]]></title>
      <guid>http://www.phpdeveloper.org/news/14490</guid>
      <link>http://www.phpdeveloper.org/news/14490</link>
      <description><![CDATA[<p>
In a new post to his blog today <i>Jordi Boggiano</i> talks about a task that can trip up some developers when they're trying to secure parts of their site or just create one-time use tokens - <a href="http://seld.be/notes/unpredictable-hashes-for-humans">making unpredictable hashes</a>.
</p>
<blockquote>
If you [override the default session handlers], unless you want to entrust PHP's core to do it, one thing you will have to take care of is generating unique session ids to send as a cookie to your users, allowing the session to persist. Other common use cases for such unique hashes is to generate CSRF tokens to insert in forms or URLs, and finally authentication tokens for email validation or such. 
</blockquote>
<p>
He talks about how we, as humans, aren't very good at figuring out true randomness and that hashing the information only adds to the problem. He mentions how some of the random functions in PHP aren't all that random and that there's a better way to really generate good values. He's come up with a solution (his "generateUniqueId" function) that tries to generate entropy from OpenSSL or from the COM extension or from the "/dev/urandom" on unix-based systems. It's then hashed and sent back out the other side for easy use.
</p>]]></description>
      <pubDate>Mon, 10 May 2010 13:47:44 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kavoir.com: Just Hashing is Far from Enough for Storing Passwords (Dictionary & Rainbow Attacks)]]></title>
      <guid>http://www.phpdeveloper.org/news/14156</guid>
      <link>http://www.phpdeveloper.org/news/14156</link>
      <description><![CDATA[<p>
On Kavoir.com there's a new post that reminds you that <a href="http://www.kavoir.com/2010/03/just-hashing-is-far-from-enough-how-to-position-against-dictionary-and-rainbow-attacks.html">hashing isn't enough anymore</a> to protect your users and their passwords. They offer a suggestion or two of what you can do to help lock things down a bit more.
</p>
<blockquote>
The common practice is to hash the user password and store the hash string of the password in the database. When the user tries to log in and supplies his password, it is used to generate a hash string to be compared to the one stored in the database. [...] This approach may be secure in the 70s of the last century, but barely any more. 
</blockquote>
<p>
Computing has evolved enough to where hashed can be matched, sometimes in less than two or three minutes. Their answer to the problem? Generate a random salt each time you create the hash with a constant being used as a base. A code snippet calling a user-defined function and the <a href="http://php.net/sha1">sha1</a> function are included.
</p>]]></description>
      <pubDate>Tue, 09 Mar 2010 13:11:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stanislav Malyshev's Blog: Ruby-like iterators in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/13928</guid>
      <link>http://www.phpdeveloper.org/news/13928</link>
      <description><![CDATA[<p>
In <a href="http://php100.wordpress.com/2010/01/27/ruby-iterators-in-php/">this new post</a> to his blog <i>Stanislav Malyshev</i> looks at creating some Ruby-like iterators as close as they can get in PHP.
</p>
<blockquote>
I've started playing with Ruby recently, and one of the things that got my attention in Ruby were iterators. They are different inside from regular loops but work in a similar way, and looks like people (at least ones that write tutorials and code examples) like to use them. 
</blockquote>
<p>
He saw how one of the iterators worked - iterating over a Ruby hash - and wondered how difficult it'd be to write up something comparable in PHP. He creates a simple iterator, an array class to lay on top of it and an example of it in use. The use isn't as clean as the Ruby iterator, but it works similarly. He also includes a modification that lets you use ranges for what to return.  
</p>]]></description>
      <pubDate>Thu, 28 Jan 2010 11:21:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Abhinav Singh's Blog: How to add content verification using hmac in PHP ]]></title>
      <guid>http://www.phpdeveloper.org/news/13639</guid>
      <link>http://www.phpdeveloper.org/news/13639</link>
      <description><![CDATA[<p>
If you've ever wants an easy "drop in" kind of solution for helping to protect a portion of your site, you should check out <a href="http://abhinavsingh.com/blog/2009/12/how-to-add-content-verification-using-hmac-in-php/">this new post</a> from <i>Abhinav Singh</i> about using the <a href="http://php.net/manual/en/function.hash-hmac.php">has_hmac</a> functionality to do just that.
</p>
<blockquote>
Many times a requirement arises where we are supposed to expose an API for intended users, who can use these API endpoints to GET/POST data on our servers. But how do we verify that only the intended users are using these API's and not any hacker or attacker. In this blog post, I will show you the most elegant way of adding content verification using <a href="http://php.net/manual/en/function.hash-hmac.php">hash_hmac</a> (Hash-based Message Authentication Code) in PHP. This will allow us to restrict possible misuse of our API by simply issuing an API key for intended users.
</blockquote>
<p>
You set up a private and public key for each of the users wanting to connect to the resource. They can then use the hmac functionality to set those over to the requesting page as a part of the message (GET/POST) where the public key is used to check the validity of the request and either allow or deny it. 
</p>]]></description>
      <pubDate>Tue, 08 Dec 2009 10:39:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matt Butcher's Blog: A Set of Objects in PHP: Arrays vs. SplObjectStorage]]></title>
      <guid>http://www.phpdeveloper.org/news/12720</guid>
      <link>http://www.phpdeveloper.org/news/12720</link>
      <description><![CDATA[<p>
The Standard PHP Library offers PHP developers some excellent tools that, in some cases, can make quite a bit of performance difference than some of their normal counterparts in the rest of the language. In <a href="http://technosophos.com/content/set-objects-php-arrays-vs-splobjectstorage">this post</a> from <i>Matt Butcher</i>, two features are compared - normal arrays and the SplObjectStorage feature of the SPL.
</p>
<blockquote>
One of my projects, <a href="http://querypath.org/">QueryPath</a>, performs many tasks that require maintaining a set of unique objects. In my quest to optimize QueryPath, I have been looking into various ways of efficiently storing sets of objects in a way that provides expedient containment checks. [...] Recently I narrowed the list of candidates down to two methods: Use good old fashioned arrays to emulate a hash set or use the SPLObjectStorage system present in PHP 5.2 and up.
</blockquote>
<p>
He <a href="http://technosophos.com/content/set-objects-php-arrays-vs-splobjectstorage">works through the comparison</a>, showing how each of them can emulate the hashed set with the goal of being able to easily iterate and simple to search. The result is that PHP's normal arrays best the SplObjectStorage object in his benchmarking (code included).
</p>]]></description>
      <pubDate>Fri, 19 Jun 2009 13:46:33 -0500</pubDate>
    </item>
  </channel>
</rss>

