<?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>Tue, 18 Jun 2013 18:28:25 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Scott MacVicar's Blog: Accessing pseudo random data with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11571</guid>
      <link>http://www.phpdeveloper.org/news/11571</link>
      <description><![CDATA[<p>
To help alleviate some <a href="http://www.suspekt.org/2008/08/17/mt_srand-and-not-so-random-numbers/">recent complaints</a> about the pseudo-random nature of the random functions in PHP, <i>Scott MacVicar</i> has proposed an <a href="http://www.macvicar.net/blog/2008/12/accessing-pseudo-random-data-with-php.html">alternate solution</a>:
</p>
<blockquote>
With all these potential different ways to get some pseudo random data it would be hard to do this in native PHP. Now we could do this in C and implement all the code ourselves but why risk implementing our own random functions and potentially making a mistake? The answer is OpenSSL, we already have an OpenSSL module and obviously they have some random functionality built in for when you go to generate SSL certificates.
</blockquote>
<p>
You can make a call to the openssl_random_pseudo_bytes (in PHP 5.3) to grab the number of bytes you need and pass in a "strong" value to get a more cryptographically secure value.
</p>]]></description>
      <pubDate>Mon, 15 Dec 2008 10:24:17 -0600</pubDate>
    </item>
  </channel>
</rss>
