<?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, 22 May 2013 01:47:49 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Better Understanding Random]]></title>
      <guid>http://www.phpdeveloper.org/news/19513</guid>
      <link>http://www.phpdeveloper.org/news/19513</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial talking about <a href="http://phpmaster.com/better-understanding-random">randomness in PHP</a>, what it is and some of the things it can be used for.
</p>
<blockquote>
Use of random values is very important in the computer security field. It is crucial in computer programming for development of secure systems that are not vulnerable to malicious subversion. Cryptography relies on random value's generation and their reproducibility for unpredictable output that is core for security of any system. Random values are fundamental for secure coding practices and PHP highly makes use of them for security. You will find them used in all libraries and frameworks and almost all codes rely on them for the generation of tokens, salts and as inputs for further functions.
</blockquote>
<p>
He talks about the important of good random numbers and some of the common uses for it including generating salts and unique identifiers. He mentions the "pseudorandomness" of PHP's generators and how they're seeded to help increase this randomness. He finishes up the tutorial with some suggestions and language features for creating "as random as possible" values like using "/dev/urandom" on Linux-based systems.
</p>
Link: http://phpmaster.com/better-understanding-random]]></description>
      <pubDate>Fri, 26 Apr 2013 11:52:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara: Seven Ways To Screw Up BCrypt]]></title>
      <guid>http://www.phpdeveloper.org/news/18934</guid>
      <link>http://www.phpdeveloper.org/news/18934</link>
      <description><![CDATA[<p>
If you're going to be rolling your own user handling in your application, no doubt you've heard that something like bcrypt-ing your passwords is a good idea. Well, <i>Anthony Ferrara</i> <a href="http://blog.ircmaxell.com/2012/12/seven-ways-to-screw-up-bcrypt.html">has some suggestions</a> for you and shows you seven ways you can "screw up" when trying ti implement it.
</p>
<blockquote>
There are numerous articles on the web about how to properly use bcrypt in PHP. So this time, rather than write yet-another-how-to-use-bcrypt article, I'm going to focus on the mistakes that are commonly made when implementing bcrypt. 
</blockquote>
<p>Here's the list of seven ways (each has its own description in the post):</p>
<ul>
<li>Using A Non-Random Salt
<li>Using An Incorrect Random Source for Salt Generation
<li>Using Too Weak Of A Cost Parameter
<li>Using The Wrong PHP Version
<li>Using The Wrong Prefix
<li>Not Checking For Errors
<li>Not Using A Library
</ul>
<p>
He also includes two "bonus" things to consider: "Not Using A Timing Safe Comparison" and "Not Encoding The Salt Correctly".
</p>]]></description>
      <pubDate>Fri, 21 Dec 2012 12:20:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Random Bugs and Testing RCs]]></title>
      <guid>http://www.phpdeveloper.org/news/17590</guid>
      <link>http://www.phpdeveloper.org/news/17590</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Derick Rethans</i> mirrors the call made by <i>Rasmus Lerdorf</i> at this year's PHP UK Conference - <a href="http://derickrethans.nl/random-bugs-and-testing-rcs.html">get involved</a> (and help test PHP)!
</p>
<blockquote>
At the <a href="http://phpconference.co.uk/">PHP UK Conference</a> <a href="http://twitter.com/rasmus">Rasmus</a> mentioned that he wants more people contributing to PHP. There are plenty of ways how you can do that.
</blockquote>
<p>
<i>Derick</i> points out two more immediate ways you can help, one not even requiring any C knowledge:
</p>
<ul>
<li>Help test the Release Candidates (like the current PHP 5.4.0 RC8) with a call to "make test" just after your compile. 
<li>The recently added "random PHP bug" functionality that's been added to the <a href="http://bugs.php.net/random">bugs.php.net site</a>
</ul>]]></description>
      <pubDate>Mon, 27 Feb 2012 11:48:29 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint.com: How to Create Your Own Random Number Generator in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17524</guid>
      <link>http://www.phpdeveloper.org/news/17524</link>
      <description><![CDATA[<p>
On SitePoint.com today there's a new tutorial showing how to <a href="http://www.sitepoint.com/php-random-number-generator/">create a random number generator</a> in PHP (with the help of methods like <a href="http://php.net/mt_rand">mt_rand</a> and <a href="http://php.net/mt_srand">mt_srand</a>).
</p>
<blockquote>
Computers cannot generate random numbers. A machine which works in ones and zeros is unable to magically invent its own stream of random data. However, computers can implement mathematical algorithms which produce pseudo-random numbers. They look like random numbers. They feel like random distributions. But they're fake; the same sequence of digits is generated if you run the algorithm twice.
</blockquote>
<p>
Included in the post is code showing how to use the random functions and how to create a class (Random) that provides a few methods to help make generation easier - "seed" and "num". It first calls "seed" with a number to start the random generator off with and then "num" in a loop to pull out random values based on that. 
</p>]]></description>
      <pubDate>Thu, 09 Feb 2012 10:03:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara's Blog: Random Number Generation In PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16617</guid>
      <link>http://www.phpdeveloper.org/news/16617</link>
      <description><![CDATA[<p>
<i>Anthony Ferrara</i> has a new post to his blog today looking at true random number generation as it relates to predictability and bias. He <a href="http://blog.ircmaxell.com/2011/07/random-number-generation-in-php.html">also talks about</a> a method/tool you can use (based on RFC 4086) to generate truly random numbers - <a href="https://github.com/ircmaxell/PHP-CryptLib/">PHP-CryptLib</a>.
</p>
<blockquote>
When we talk about "random" numbers, we generally talk about two fundamental properties: Predictability and Bias. Both are closely related, but are subtly different. Predictability in reference to random numbers is the statistical problem of predicting the next value when knowing any number of previous values. Bias on the other hand is the statistical problem of predicting the next value when knowing the distribution of previous values.
</blockquote>
<p>
He looks at how predictability can effect true random number generation and a common mistake in generation related to bias in the calculation method. He talks about <a href="http://us.php.net/manual/en/function.rand.php">some</a> of <a href="http://us.php.net/manual/en/function.mt-rand.php">the</a> <a href="http://us.php.net/manual/en/function.lcg-value.php">functions</a> <a href="http://us.php.net/manual/en/function.uniqid.php">PHP includes</a> to work with randomness, but notes that they all have their flaws. He points to <a href="https://github.com/ircmaxell/PHP-CryptLib/">the PHP-CryptLib</a> package as a solution (adhering to the <a href="http://tools.ietf.org/html/rfc4086">guidelines in RFC 4086</a> for randomness). He includes some sample code of how to use it to generate random numbers, tokens and sets of bytes. You can find the full source <a href="https://github.com/ircmaxell/PHP-CryptLib">over on github</a>.
</p>]]></description>
      <pubDate>Thu, 21 Jul 2011 10:03:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[MySQL Performance Blog: Sample datasets for benchmarking and testing]]></title>
      <guid>http://www.phpdeveloper.org/news/15881</guid>
      <link>http://www.phpdeveloper.org/news/15881</link>
      <description><![CDATA[<p>
In <a href="http://www.mysqlperformanceblog.com/2011/02/01/sample-datasets-for-benchmarking-and-testing/">a recent post</a> to the MySQL Performance Blog, there's a pointer to a few resources you can use if you need some sample datasets to run your application against - everything from airline flight information to energy usage data.
</p>
<blockquote>
Sometimes you just need some data to test and stress things. But randomly generated data is awful - it doesn't have realistic distributions, and it isn't easy to understand whether your results are meaningful and correct. Real or quasi-real data is best. Whether you're looking for a couple of megabytes or many terabytes, the following sources of data might help you benchmark and test under more realistic conditions.
</blockquote>
<p>
The sample data sets vary from <a href="http://forge.mysql.com/wiki/SakilaSampleDB">fake movie information</a> to sample <a href="http://dammit.lt/wikistats/archive/">site traffic data</a> to the <a href="http://aws.amazon.com/publicdatasets/">large data sets</a> that Amazon provides (including the Human Genome and US Census data). Some of <a href="http://www.mysqlperformanceblog.com/2011/02/01/sample-datasets-for-benchmarking-and-testing/#comments">the comments</a> also link to other sources.
</p>]]></description>
      <pubDate>Wed, 09 Feb 2011 13:19:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: How not to create a Random string]]></title>
      <guid>http://www.phpdeveloper.org/news/15498</guid>
      <link>http://www.phpdeveloper.org/news/15498</link>
      <description><![CDATA[<p>
In <a href="http://www.codediesel.com/php/how-not-to-create-a-random-string/">this latest post</a> to his blog, <i>Samer Borate</i> talks about how not to create random strings and how, if you're not careful, it could backfire on you.
</p>
<blockquote>
It is surprising to see how after all the code floating around people still find it hard to create random numbers. In a recent piece of code I encountered, the following was used to generate a string of random numbers. The code was written to provide a random string to be passed to a email verifier system - the type wherein a new user when he subscribes to a website needs to verify his email by clicking on a provided link.
</blockquote>
<p>
He includes a snippet of the code that uses a call to <a href="http://php.net/str_shuffle">str_shuffle</a> on the set of numbers 1-10 to generate a random number. The only problem with the method is that, when the number gets large enough, PHP would automatically kick it into exponential format - not exactly ideal for an email link. Let this serve as a reminder for any scripts you might make that are similar.
</p>]]></description>
      <pubDate>Fri, 26 Nov 2010 10:18:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect: Possible vulnerabilities found in PHP session IDs ]]></title>
      <guid>http://www.phpdeveloper.org/news/14331</guid>
      <link>http://www.phpdeveloper.org/news/14331</link>
      <description><![CDATA[<p>
<i>Beth Tucker Long</i> has posted a new warning <a href="http://www.phparch.com/2010/04/09/possible-vulnerabilities-found-in-php-session-ids">about a possible issue with session IDs</a> in PHP dealing with <a href="http://seclists.org/fulldisclosure/2010/Mar/519">weak random numbers</a> being generated by the language when making the IDs.
</p>
<blockquote>
Seclists.org has posted an advisory titled "<a href="http://seclists.org/fulldisclosure/2010/Mar/519">Weak RNG in PHP session ID generation leads to session hijacking</a>." RNG stands for Random Number Generation, and the advisory is warning that not enough entropy is being used to seed the RNG; this, in turn, can lead to a reduced number of possible session IDs under certain specific conditions, thus making brute force session spoofing easier, if not bringing it into the realm of feasibility.
</blockquote>
<p>
The threat is only marked at a "medium" level of severity, but it could still cause problems if you're not careful. There are specific conditions that have to be in place for it to be a problem including using the standard PHP session generation and that the app shares the information about remote users. To protect yourself you can either install <a href="http://www.hardened-php.net/suhosin/">Suhosin</a> and don't use the result of <a href="http://php.net/uniqid</a> directly, hash it. You can also <a href="http://www.php.net/manual/en/session.configuration.php#ini.session.entropy-file">set an external source</a> for entropy to help randomize the session ID even more.
</p>]]></description>
      <pubDate>Mon, 12 Apr 2010 08:29:00 -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[ITNewb.com: Generating Session IDs and Random Passwords with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/12599</guid>
      <link>http://www.phpdeveloper.org/news/12599</link>
      <description><![CDATA[<p>
New on the ITNewb.com site today is <a href="http://www.itnewb.com/v/Generating-Session-IDs-and-Random-Passwords-with-PHP">this new tutorial</a> looking at generating session ID numbers and random passwords for your application using functions like <a href="http://php.net/mt_rand">mt_rand</a> and <a href="http://php.net/mt_srand">mt_srand</a>.
</p>
<blockquote>
Whether it's session ids, passwords or tokens in general, in the world of web development the ability to generate random alpha-numeric strings is a necessity. In this article I present a few simple yet effective PHP functions that can be used to generate strong alpha, numeric and/or special character tokens and passwords.
</blockquote>
<p>
He gives examples of generating tokens and generating passwords, each with a custom function which he explains and gives a usage example for.
</p>]]></description>
      <pubDate>Mon, 01 Jun 2009 08:46:50 -0500</pubDate>
    </item>
  </channel>
</rss>
