Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Conversation

@sarciszewski
Copy link
Contributor

Also pulled all of the testing code out of the main csrpng.php file

@sarciszewski
Copy link
Contributor Author

I typed this up on the bus, forgot to summarize what it does:

  • random_bytes()
    • uses mcrypt_create_iv() with MCRYPT_DEV_URANDOM if it's available and on a safe PHP version
    • uses openss_random_pseudo_bytes()
    • reads from /dev/urandom as a fallback (PHP < 5.3.7)
    • TODO: add CAPICOM support (a'la my WordPress patch)
  • random_hex() just grabs data from random_bytes() and converts it to hex
  • random_int() uses random_bytes() to create an integer

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to include this since csprng-real.php is the file I run after compiling the PHP-src patch to test it. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants