The htpasswd
tool is capable of generating a handful of hashed password types. You're using the -d
flag, which uses the prehistoric crypt()
hash format. crypt()
hashes are amazingly insecure and deliciously easy to crack.
According to this manual page from Oracle 10g, the DBMS_CRYPTO
package does not support crypt()
. This isn't surprising.
You're going to need to switch to a different hashing algorithm in order to pull this off. The most straight-forward way would be the equivalent of using the -s
flag instead of the -d
flag to create SHA1 passwords. Try it out on the command line to see the results. The password format given is the literal string {SHA}
, followed by the base64 encoded SHA1 hash, with no salting. The DBMS_CRYPTO
package seems to support SHA1 and hints that there's a function to do base64 encoding as well. Or, if you're doing the .htpasswd file generation yourself, you can simply store the hash in whatever way you prefer and convert it on output using your language of choice.