<?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>Sat, 18 May 2013 09:41:38 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Kevin Schroeder: Generating secure cross site request forgery tokens (csrf)]]></title>
      <guid>http://www.phpdeveloper.org/news/19164</guid>
      <link>http://www.phpdeveloper.org/news/19164</link>
      <description><![CDATA[<p>
In <a href="http://www.eschrade.com/page/generating-secure-cross-site-request-forgery-tokens-csrf/">this new post</a> to his site <i>Kevin Schroeder</i> has a new post with his take on generating more secure CSRF tokens for use in your site.
</p>
<blockquote>
In researching <a href="http://www.eschrade.com/page/the-ibm-i-programmers-guide-to-php-second-edition/">the second edition</a> for the <a href="http://www.amazon.com/IBM-Programmers-Guide-PHP/dp/1583470832">IBM i Programmer's Guide to PHP</a> Jeff and I decided to include a chapter on security since we really didn't talk much about it in the first edition.  I'm talking about cross site request forgeries right now and I wanted to make sure that what I was going to suggest would not <a href="http://www.youtube.com/watch?v=qdjRwpYM-Kw">break the internet</a> in some way. I did some Google searching to see what other people were recommending. 
</blockquote>
<p>
Most of the examples he saw used <a href="http://php.net/md5">md5</a>, <a href="http://php.net/uniqid">uniqid</a> and <a href="http://php.net/rand"> rand</a> to create a randomized hash. He suggests an alternative - a method using the <a href="http://php.net/hash_hmac">hash_hmac</a> and <a href="http://php.net/openssl_random_pseudo_bytes"> openssl_random_pseudo_bytes</a> methods to generate a sha256 hash for use in your page's submissions.
</p>]]></description>
      <pubDate>Mon, 11 Feb 2013 11:23:10 -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[DevX.com: A Guide to Cryptography in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10123</guid>
      <link>http://www.phpdeveloper.org/news/10123</link>
      <description><![CDATA[<p>
The DevX.com site has posted an <a href="http://www.devx.com/webdev/Article/37821">introductory guide</a> to using cryptography in PHP, showing how to use the various packages the language has to offer.
</p>
<blockquote>
Cryptography is just one piece of the security puzzle, along with SSL/TLS, certificates, digital signatures, and so on. This article explains how to use PHP to implement the most common cryptographic algorithms. In addition to describing PHP's default encryption functions, you'll see how to use a wide variety of cryptographic libraries and packages.
</blockquote>
<p>
They start with a look at some of the built-in functions like md5, sh1 and crypt as well as a table detailing the different encryption methods (like mcrypt, mhash or crypt_blowfish). They follow this up with examples of some of them including a method for making secret keys with the <a href="http://pear.php.net/package/Crypt_DiffieHellman">Crypt_DiffieHellman PEAR Package</a>.
</p>]]></description>
      <pubDate>Tue, 06 May 2008 13:47:22 -0500</pubDate>
    </item>
  </channel>
</rss>
