I have to have a cryptographically secure function,that gives me a random string, for encryption. Is the following function good enough for this?
'PHP'
function GenerateRandomString($Length) {
$Length /= 2;
$cstrong = false;
while ($cstrong != TRUE){
$bytes = openssl_random_pseudo_bytes($Length, $cstrong);
}
$hex = bin2hex($bytes);
return $hex;
}