<?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>Mon, 20 May 2013 04:37:30 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Reddit.com: Login Security (Best Practices Recommendations)]]></title>
      <guid>http://www.phpdeveloper.org/news/18359</guid>
      <link>http://www.phpdeveloper.org/news/18359</link>
      <description><![CDATA[<p>
On Reddit.com there's a good conversation going on in the PHP category about <a href="http://www.reddit.com/r/PHP/comments/y4wuc/login_security/">login security</a> and best practices surrounding it.
</p>
<blockquote>
So I was handed an ancient project which was up to me to fix / improve. About a week later I am about done but there is 1 thing I left...Login security. As it is now, it's just md5(password) that's saved in the database. Better then nothing, but far from good enough. My plan was to have a constant pepper in the class which handles the logins, then do something like crypt(pepper . $password) to store it, since that should generate a random salt and is slower then sha1 / md5 / etc. I feel this should be save enough, do any of you have any ideas on how to improve it (without non-standard extensions)?
</blockquote>
<p>
There's lots of <a href="http://www.reddit.com/r/PHP/comments/y4wuc/login_security/#comments">comments</a> so far and a lot of them are following along the same lines - use a better method of encryption, something like <a href="http://php.net/manual/en/function.crypt.php">crypt</a> with Blowfish or something similar as well as some hashing (like <a href="http://php.net/manual/en/function.hash-hmac.php">HMAC</a>). 
</p>]]></description>
      <pubDate>Tue, 14 Aug 2012 12:20:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Hasin Hayder's Blog: RSA Encrypting and Decrypting data with Zend_Crypt_Rsa Library]]></title>
      <guid>http://www.phpdeveloper.org/news/16846</guid>
      <link>http://www.phpdeveloper.org/news/16846</link>
      <description><![CDATA[<p>
<i>Hasin Hayder</i> has recently posted a tutorial to his blog showing how to <a href="http://hasin.wordpress.com/2011/09/11/rsa-encrypting-and-decrypting-data-with-zend_crypt_rsa-library/">use the Zend_Crypt_Rsa library for encrypting/decrytping data</a> in a Zend Framework application.
</p>
<blockquote>
Public/private key based encryption is very popular because of the strength it sets in encryption, specially above 1024 bits. Now there are external library to encrypt data using <a href="http://en.wikipedia.org/wiki/RSA">RSA encryption</a> like <a href="http://www.phpclasses.org/package/4121-PHP-Encrypt-and-decrypt-data-with-RSA-public-keys.html">RSA</a> in <a href="http://phpclasses.org/">phpclasses.org</a> - the fun is we were also using this library in one of our ZF based project. But last week I've found that there is a hidden gem in the Library/Zend/Crypt folder (Zend_Crypt_Rsa) which can do the same thing using openssl library. 
</blockquote>
<p>
He couldn't find much in the way of documentation for the component, so he wrote up how to use it in three easy steps:
</p>
<ul>
<li>Create your RSA public/private key using ssh-keygen
<li>Encrypt data using your public key
<li>Decrypt the cipher
</ul>
<p>
The Zend_Crypt_Rsa makes it simple to encrypt/decrypt the data, just taking in a passphrase, a path to the RSA key file and the message contents.
</p>]]></description>
      <pubDate>Mon, 12 Sep 2011 11:17:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Encrypting uploaded files in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15402</guid>
      <link>http://www.phpdeveloper.org/news/15402</link>
      <description><![CDATA[<p>
In <a href="http://www.codediesel.com/php/encrypting-uploaded-files-in-php/">this new post</a> to his blog <i>Sameer Borate</i> looks at a method he's come up with to encrypt files uploaded into your application with the help of the <a href="http://framework.zend.com/manual/en/zend.filter.set.html">Zend_Filter</a> component of the Zend Framework.
</p>
<blockquote>
As earlier I'd encountered Zends wonderful <a href="http://framework.zend.com/manual/en/zend.filter.set.html">Zend_Filter</a> class, I decided to go with it and use the Zend_Filter_Encrypt and Zend_Filter_Decrypt to accomplish the work. The Zend_Filter component provides a set of common useful data filters, among which are the encryption filters. Although my project was not developed in Zend, I could easily integrate the required classes in the code. Note that Zend has a great upload library, <a href="http://framework.zend.com/manual/en/zend.file.transfer.introduction.html">Zend_File_Transfer</a>, that lets you easily manage file uploading and also encryption, but as I already had the upload code tested, I decided to just add the encryption part.
</blockquote>
<p>
He includes the step-by-step process to get everything you need and which files you'll need to have included from the framework to make things work. He includes code for both encrypting and decrypting the file information as well as hints on selecting an algorithm and a random initialization vector. You can <a href="http://www.codediesel.com/downloads/encrypt">download the complete source</a> if you want to jump right in.
</p>]]></description>
      <pubDate>Tue, 09 Nov 2010 09:43:13 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: Storing encrypted session information in a cookie]]></title>
      <guid>http://www.phpdeveloper.org/news/14789</guid>
      <link>http://www.phpdeveloper.org/news/14789</link>
      <description><![CDATA[<p>
<i>Evert Pot</i> has <a href="http://www.rooftopsolutions.nl/blog/storing-encrypted-session-information-in-a-cookie">a quick new post</a> to his blog today talking about how to push encrypted information into a cookie for storage.
</p>
<blockquote>
There have been a couple of approaches I've been considering [to replace sessions being stored in the database], one of which is simply storing all the information in a browser cookie. First I want to make clear I don't necessarily condone this. The reason I'm writing this post, is because I'm hoping for some more community feedback. Is this a really bad idea? I would love to know.
</blockquote>
<p>
He includes some code to make it happen - a class that uses the <a href="http://php.net/hash_hmac">hash_hmac</a> function and a SHA1 encryption type (along with a salt) to convert the information into a string that can be (relatively) safely stored in a cookie. Be sure to <a href="http://www.rooftopsolutions.nl/blog/storing-encrypted-session-information-in-a-cookie#comments">read the comments</a> for more opinions on the method.
</p>]]></description>
      <pubDate>Wed, 14 Jul 2010 09:13:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: Simple Techniques to Lock Down your Website]]></title>
      <guid>http://www.phpdeveloper.org/news/13330</guid>
      <link>http://www.phpdeveloper.org/news/13330</link>
      <description><![CDATA[<p>
On NETTUTS.com today there's <a href="http://net.tutsplus.com/tutorials/php/simple-techniques-to-lock-down-your-website/">a new post</a> by <i>Dustin Blake</i> with a few simple tips and helpful techniques to locking down and protecting your website with some simple PHP scripts.
</p>
<blockquote>
One crucial part of PHP development practice is always keeping in mind that security is not something you can simply buy off the shelf at your local convenient store. Ensuring the security of your web applications is a process, which over time, needs to be constantly evaluated, monitored, and hardened.
</blockquote>
<p>
He shows a few methods you can use to secure things - generating random values, making random passwords to give to your users, creating salted passwords, obfuscation and an overview of cryptography in PHP. <a href="http://nettuts.s3.amazonaws.com/453_php/examples.zip">Complete source code</a> is included.  
</p>
]]></description>
      <pubDate>Mon, 05 Oct 2009 07:54:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: Creating a Crypter Class with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/13290</guid>
      <link>http://www.phpdeveloper.org/news/13290</link>
      <description><![CDATA[<p>
On the NETTUTS.com site there's <a href="http://net.tutsplus.com/tutorials/php/creating-a-crypter-class/">a new tutorial</a> posted looking at creating a "crypter" class in PHP - a handy class to make encryption and decryption of data simpler.
</p>
<blockquote>
Think about what we might need a class like this for? We want to encrypt important data with a password for security reasons. We also want, as already mentioned, to be able to decrypt that data when necessary. Why should you use symmetric algorithms? It's easy; when you're offering a password sent via email or something like that, you need the password to be sent in plaintext. The hash algorithms are not reversible. Once you have hashed a string you can't decipher the original text from the hash. 
</blockquote>
<p>
He lays out his basic class with three methods - the constructor that sets up the key and algorithm and the encrypt and decrypt functions. These use to <a href="http://php.net/mcrypt">mcrypt</a> functions to handle the heavy lifting.  
</p>]]></description>
      <pubDate>Mon, 28 Sep 2009 07:51:19 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Using GnuPG with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10758</guid>
      <link>http://www.phpdeveloper.org/news/10758</link>
      <description><![CDATA[<p>
The Zend Developer Zone has a <a href="http://devzone.zend.com/article/3753-Using-GnuPG-with-PHP">new tutorial</a> posted today showing how to use the open source encryption tool GnuPG from inside PHP.
<p>
<blockquote>
While GnuPG works very well as a standalone tool, it also plays very well with PHP. This integration is possible due to PHP's ext/gnupg extension, which provides a flexible and powerful API to access GnuPG functions for encryption, decryption, message signing and verification, and key maintenance. And your mission (should you choose to accept it) will be to accompany me over the next few pages, while I give you a crash course in this API, showing you how easy it is to integrate these functions into your next PHP application.
</blockquote>
<p>
The <a href="http://devzone.zend.com/article/3753-Using-GnuPG-with-PHP">tutorial</a> walks you through some of the basic concepts behind the "lock and key" GnuPG implements and how to get the extension installed so you can follow along. His examples range from a basic encryption of a string out to a full encrypt/decrypt example, how to sign information with a key and even a method for sending an encrypted message.
</p>]]></description>
      <pubDate>Mon, 04 Aug 2008 14:32:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Andreas Gohr's Blog: Working with Password Hashes in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10708</guid>
      <link>http://www.phpdeveloper.org/news/10708</link>
      <description><![CDATA[<p>
<i>Andreas Gohr</i> has a <a href="http://www.splitbrain.org/blog/2008-07/28-working_with_password_hashes_in_php">general overview</a> of hashing in a new post to his blog:
</p>
<blockquote>
Every good programmer knows, that passwords should never be stored in clear text. Instead a one way hash (or digest) should be used. This way user passwords are not at risk in case of an intrusion.
</blockquote>
<p>
He points out the multiple ways that PHP offers for both simple hashing (like md5 or sha1) and the true encryption types (like ssha, apr1 and crypt). He shows how they work in the <a href="http://www.splitbrain.org/projects/dokuwiki">DokuWiki</a> application via a call to auth_cryptPassword to make it and db_get_hash/auth_verifyPassword to check against it.
</p>]]></description>
      <pubDate>Tue, 29 Jul 2008 12:57:43 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Harry Fuecks' Blog: Using OpenSSL, RSA and RC4 to exchange encrypted data from PHP to Java]]></title>
      <guid>http://www.phpdeveloper.org/news/8935</guid>
      <link>http://www.phpdeveloper.org/news/8935</link>
      <description><![CDATA[<p>
<i>Harry Fuecks</i> came across a need in his development work to bridge a gap between a PHP script and some Java work he'd done. He <a href="http://blog.local.ch/archive/2007/10/29/openssl-php-to-java.html">found the way</a> that fit his situation the best - the encryption of the data on the PHP side via OpenSSL.
</p>
<blockquote>
<p>
Needed a mechanism to be able to pass chunks of data securely from PHP to Java [...] One solution might be something "from scratch" involving mcrypt or PHP libraries like Crypt_RSA. [...] Another approach is GnuPG, either via the command line as discussed in this tutorial or via the GnuPG extension from PECL.
</p>
<p>
Option 3 is using OpenSSL and PHP's openssl_seal() function. SSL is normally used for encrypting networked communication between peers but that's not all it can do. [...] What's more - and perhaps the biggest win - it also allows us to re-use existing SSL certificates.
</p>
</blockquote>
<p>
He <a href="http://blog.local.ch/archive/2007/10/29/openssl-php-to-java.html">uses</a> the <a href="http://www.php.net/openssl_seal">openssl_seal</a> functionality on top of the EVP encrypted envelope on the certificate to handle the encrypt/decrypt of the data. Both the PHP code and Java code (and execution example) are included in the post.
</p>]]></description>
      <pubDate>Tue, 30 Oct 2007 11:14:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Protecting Your PHP Code]]></title>
      <guid>http://www.phpdeveloper.org/news/8302</guid>
      <link>http://www.phpdeveloper.org/news/8302</link>
      <description><![CDATA[<p>
In a <a href="http://www.littlehart.net/atthekeyboard/2007/07/20/protecting-your-php-code/">new post</a> to his blog, <i>Chris Hartjes</i>, spurred on by an article in the latest edition of php|architect magazine (covering protecting your code), has shared a few opinions starting with a certain paragraph near the end.
</p>
<blockquote>
To start, I will focus on the paragraph above. What I get out of that is that if only your source was closed and hidden from prying eyes, it would not have bugs in it. Which is, of course, total nonsense. Code has bugs because it's open and they feel safer? There are two kinds of bugs: application bugs (which is the code I would write) and system bugs (in this case, bugs that that appear from PHP itself). I'm sorry, but there is nothing I can do if there is a bug in PHP that causes my application to crash except to point this bug out to the people who have the ability to fix it.
</blockquote>
<p>
He <a href="http://www.littlehart.net/atthekeyboard/2007/07/20/protecting-your-php-code/">goes on</a> to talk more about how protection like this (the article talks about using the IonCube Encoder) will not stop someone if they're really determine to get at the code underneath the encryption. His only suggestion is to make an application good enough that people wouldn't want to try to steal it as much and would rather pay for their version.
</p>
<blockquote>
Encode your stuff if you want, but be aware that the minute you choose to do that you are telling your customers "I don't trust you" and I have a hard time understanding a business model that assumes people are going to want to steal the stuff you sell.
</blockquote>]]></description>
      <pubDate>Mon, 23 Jul 2007 07:55:00 -0500</pubDate>
    </item>
  </channel>
</rss>
