I am currently generating a salted SHA 256 passwords in the below format
$hash = "{SHA256}".base64_encode(hash('sha256', $password . $salt) . $salt) .
Using the below libraries of Java classes to generate.
java.security.MessageDigest
java.security.SecureRandom
I am not sure if the random salt generated via SecureRandom
class is secure enough.
I wanted to know how different LDAP implementations (OpenLDAP,OpenDJ) are generating the random salt for different password storage scheme like SHA-1, SHA256 etc?
Can those salt generation algorithms used by different LDAP implementations be utilised by us in our scripts (using js) to generate same. I am using js scripts (Rhino js engine) to generate salted sha256 password.
Are there any other random generators which are secure enough and can be used in our application?