<?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>Thu, 24 May 2012 09:43:48 -0500</pubDate>
    <ttl>30</ttl>
    <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>
    <item>
      <title><![CDATA[Zend Developer Zone: Fetching multiple random rows from a database]]></title>
      <guid>http://www.phpdeveloper.org/news/12466</guid>
      <link>http://www.phpdeveloper.org/news/12466</link>
      <description><![CDATA[<p>
On the Zend Developer Zone, a <a href="http://devzone.zend.com/article/4571-Fetching-multiple-random-rows-from-a-database">recently posted tutorial</a> looks at fetching multiple random rows from a database table (in a MySQL database).
</p>
<blockquote>
As a follow up to my earlier article about <a href="http://www.dasprids.de/blog/2008/06/07/fetching-random-rows-of-mysql-efficiently">fetching a single random row from MySQL</a> I will tell you today, how you can fetch multiple random rows from a table without any hassle. Compared to the solution with fetching a single random row, fetching multiple random rows requires some tricks.
</blockquote>
<p>
The tutorial walks you through the creation of some sample tables, making a simple trigger to keep a "random ID" column in a value range of one to the number of rows (gapless) and a bit of PHP code to select some IDs from the table and the SQL to get their information.
</p>
<p>
Be sure to check out <a href="http://devzone.zend.com/article/4571-Fetching-multiple-random-rows-from-a-database#comments">the comments</a> for mentions of the number of table reads and how optimized certain parts of the queries might be.
</p>]]></description>
      <pubDate>Wed, 06 May 2009 11:17:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[WebReference.com: User Personalization with PHP: The Verification Code]]></title>
      <guid>http://www.phpdeveloper.org/news/12150</guid>
      <link>http://www.phpdeveloper.org/news/12150</link>
      <description><![CDATA[<p>
WebReference.com continues their look at user personalization with the <a href="http://www.webreference.com/programming/php/user_personalization2/index.html">second part</a> of the series - how to validate that the users signing up for your site are valid. (Here's <a href="http://www.phpdeveloper.org/news/12026">part one</a>, the introduction).
</p>
<blockquote>
In this article, we will be looking at user authentication. User authentication simply means verifying that a particular user has the right to access a part of our application. Because our application deals with user preferences, access control is even more pertinent especially since multiple users are going to try to access this application at any given time. 
</blockquote>
<p>
As a part of this user validation and customization, they need to create a form that non-human scripts have a harder time using (hopefully weeding them out and getting better user information). The article steps you through a few lines of code that you can use to create a simple image of a four-digit number whose value is placed in a session variable so it can be validated on submission of the form.
</p>]]></description>
      <pubDate>Tue, 17 Mar 2009 09:37:50 -0500</pubDate>
    </item>
  </channel>
</rss>

