I need re-implement behaviour of PHP function openssl_random_pseudo_bytes
, which is according to its description:
openssl_random_pseudo_bytes — Generate a pseudo-random string of bytes
As it is just pseudo-random string of bytes, and as I need hex representation of it, I could use just this function. But there is also additional parameter:
crypto_strong
If passed into the function, this will hold a boolean value that determines if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG, passwords, etc. TRUE if it did, otherwise FALSE
So core of my question is: what exactly does this crypto_strong parameter? How I should correctly re-implement this behaviour?
NB! Can I just use java.security.SecureRandom()
class for this purposes?