php Programming Glossary: urandom
Secure random number generation in PHP http://stackoverflow.com/questions/1182584/secure-random-number-generation-in-php improve this question I strongly recommend targeting dev urandom on unix systems or the crypto api on the windows platform as.. of 16 bytes pr_bits '' Unix Linux platform fp @fopen ' dev urandom' 'rb' if fp FALSE pr_bits . @fread fp 16 @fclose fp MS Windows.. it is generally safe to leave both the attempt to read dev urandom and the attempt to access CAPICOM in your code though each will..
How does PHP's password_hash generate the salt? http://stackoverflow.com/questions/14673005/how-does-phps-password-hash-generate-the-salt buffer_valid 1 On Linux it will attempt to read dev urandom to generate the salt int fd n size_t read_bytes 0 fd open dev.. generate the salt int fd n size_t read_bytes 0 fd open dev urandom O_RDONLY if fd 0 while read_bytes raw_length n read fd buffer.. buffer buffer_valid true if buffer_valid is_readable ' dev urandom' f fopen ' dev urandom' 'r' read strlen buffer while read raw_length..
Is using microtime() to generate password-reset tokens bad practice http://stackoverflow.com/questions/15527706/is-using-microtime-to-generate-password-reset-tokens-bad-practice attack to succeed Should one be generating tokens with dev urandom or openssl_pseudo_bytes instead Is microtime bad practice php..
What is a good way to produce a random “site salt” to be used in creating password retrieval tokens? http://stackoverflow.com/questions/3290283/what-is-a-good-way-to-produce-a-random-site-salt-to-be-used-in-creating-passwo is non blocking access to an entropy pool such as dev urandom . As of PHP 5.3 PHP applications can use openssl_random_pseudo_bytes.. system under Linux this means the application will use dev urandom . This code snip from Scott is pretty good function crypto_rand_secure..
Is time() a good salt http://stackoverflow.com/questions/4983915/is-time-a-good-salt operating system on Linux this is called dev random or dev urandom both have advantages and problems choose your poison on Windows..
What's the disadvantage of mt_rand? http://stackoverflow.com/questions/7808021/whats-the-disadvantage-of-mt-rand is cryptographically strong. Alternatively read from dev urandom or dev random on a POSIX conforming operating system. share..
Proper session hijacking prevention in PHP http://stackoverflow.com/questions/8419332/proper-session-hijacking-prevention-in-php has some known flaws ini_set 'session.entropy_file' ' dev urandom' Uses a strong hash ini_set 'session.hash_function' 'whirlpool'.. configurations you are generating the session id from dev urandom which is a awesome entropy pool. This is going to be a lot more..
|