 | News Feed |
Sections
|
| feed this: |  |
Suspekt Blog: mt_srand and not so random numbers
by Chris Cornutt August 18, 2008 @ 13:49:31
Stefan Esser points out a problem with the mt_rand and rand methods in PHP that makes them not quite random enough for cryptographic uses.
PHP comes with two random number generators named rand() and mt_rand(). The first is just a wrapper around the libc rand() function and the second one is an implementation of the Mersenne Twister pseudo random number generator. Both of these algorithms are seeded by a single 32 bit dword when they are first used in a process or one of the seeding functions srand() or mt_srand() is called.
He looks at how its currently implemented, some examples of bad methods to get "random" numbers, how shared resources are a problem and an example of a cross-application attack (the application in more than once place using the same method for getting random numbers).
In the comments he recommends either grabbing from /dev/random (if you're on a unix-based system) or making the creation of your numbers a bit more complex to include things the outside world wouldn't know.
voice your opinion now!
mtrand random number rand cryptography problem
PHPClasses.org: Book Review Wicked Cool PHP Real-World Scripts That Solve Difficult Problems
by Chris Cornutt August 14, 2008 @ 10:21:27
PHPClasses.org has posted a review of a recently released book from No Starch Press, "Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems".
n the PHP development life-cycle everyone faces common problems. Considering this, No Starch Press came with a good book named "Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems" written by William Steinmetz and Brian Ward. Wicked Cool PHP is a wide collection of complete PHP scripts that solve specific problems frequently encountered by PHP coders. The book contains 12 chapters covering 76 frequently encountered problems.
He goes through each chapter, mentioning what its about and any extra tidbits it might include. There's wide range of topics covered - everything from the basics of configuring PHP out to security and user/session tracking.
voice your opinion now!
book review wicked cool nostarch problem snippet
Derick Rethans' Blog: Namespaces in PHP
by Chris Cornutt June 16, 2008 @ 07:54:39
After hearing Stefan Priebsch's talk at this year's Dutch PHP Conference, something occurred to Derick Rethans - there was a small sort of issue with using namespaces and possible future PHP's own namespace.
One of the things that came up is the conflicts that can arise with internal classes. In PHP 5.3 this would alias the class Interval in the namespace PEAR::Date to the class Interval. For now, this code would work just fine. However, if PHP would introduce a class "Interval" at some point in the future (and PHP can do this as it owns the global namespace) then the above code would suddenly stop working
He offers a simple solution that can prevent this sort of conflict for the future - defining your "use" and then creating a new instance of the namespace into a variable instead of just an "as".
voice your opinion now!
namespace problem global implement future use conflict
Stefan Mischook's Blog: Does Wordpress 2.5.1 suck?
by Chris Cornutt June 04, 2008 @ 12:08:12
On the KillerPHP blog today, Stefan Mischook comments on whether or not WordPress version 2.5.1 "sucks".
I just recently installed the this latest version of Wordpress (2.5.1) and quickly found it hanging (while trying to load a page) for as long as 40-50 seconds! I then proceeded to isolate the potential causes (database, custom fields, custom theme) and have since found out that something stinks in 2.5.1's core.
He details some of the steps he took to try to track down the bug - installing on another server, searching the web for others with the same issue. His suggestion?
Before you upgrade your old working installation of Wordpress, I would suggest that you test 2.5.1 in some other directory just to be sure it works with your server.
voice your opinion now!
wordpress problem error page hang load
PEAR Blog: First PEAR bug triage over!
by Chris Cornutt April 03, 2008 @ 10:26:34
According to this post on the PEAR blog, the first PEAR bug triage is now over:
PEAR's bug tracker hit the 600+ open bugs mark a month ago. [...] So with 600+ open bugs (not including the feature requests), we had to do something. [...] The logical step was to hold our own bug smashing event and see how it works for PEAR.
Back on March 22nd and 23rd (Easter weekend) they hunted for bugs. Several developers showed to help out and many bugs were fixed and they managed to bring the number of open bugs for PEAR down to 547 with the two days of work. There were some milestones reached too:
Thanks to the triage, we are close to reaching two important milestones: Closing bug reports with lower bug ID than 1000 (1 bug left!) and 2000 (5 left).
voice your opinion now!
pear bug triage close problem issue feature event
|
Community Events
Don't see your event here? Let us know!
|