|Ratings|| ||Unique User Downloads|| ||Download Rankings|
|Not enough user ratings||Total: 174 ||All time: 8,735 This week: 313|
This class can generate cryptographically strong random bytes.
It can generate a string of bytes with random values using a given method.
Currently it can use either methods using mcrypt, OpenSSL, or /dev/urandom on Linux. The default is to use mcrypt.
Prize: One downloadable e-book of choice by O'Reilly
|Many cryptography algorithms use random numbers to make it harder to break the security measures based on those algorithms.
There are many pseudo-random number generators that can be used to generate cryptographically strong data values.
This class can generate random streams of bytes that are more secure to use in cryptography applications by either using /dev/random on Linux, OpenSSL or mcrypt libraries.
Generate cryptographically-strong random bytes.
Create random bytes – as cryptographically-strong as possible – from available sources of entropy, and display in different output formats.
Linux/Unix: OpenSSL, `random_bytes()`, /dev/urandom
Windows: OpenSSL, `random_bytes()`
Random Bytes Definitions:
array RandomBytes::generate(int $length, string $source);
$aData = RandomBytes::generate(32, 'openssl');
The random bytes generated are only as good as the underlying entropy generator of the OS.
Linux's /dev/urandom entropy source is a non-blocking generator 'suitable for most cryptographic purposes'. (/dev/random, being blocking, isn't suitable for this script.)
OpenBSD and FreeBSD have non-blocking /dev/random implementations.
random_bytes() function was added to PHP version 7.0
Random Bytes is released under the GPL v.3.
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.