Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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');"



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

share|improve this question
up vote 1 down vote accepted

This password hashing algorithm is rather complex — see the complete description:

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


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.