Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Using PHP's crypt function as follows, I can do a sha256 hash with salt and multiple rounds.

php -r "echo crypt('foo','\$5\$rounds=5000\$saltsaltsaltsalt');"

produces:

$5$rounds=5000$saltsaltsaltsalt$5RbfsOruKYb8v7hGn29A.I91maopNeJ2nIFH.SIEnSC

How can I perform this exact process (and/or validate a hash) using the OpenSSL command line program?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This password hashing algorithm is rather complex — see the complete description: http://www.akkadia.org/drepper/SHA-crypt.txt.

Unfortunately, the openssl passwd command does not currently support it — there is support only for the old DES-based crypt(), MD5-based crypt() and the Apache apr1 variant of MD5 salted hashes. There is a Debian bug report requesting SHA-256/512 password hash support, but currently nothing has been done.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.