— hashes passwords from the
command line or standard input
prints the encrypted form of
to the standard output. This is mostly useful for
encrypting passwords from within scripts.
The options are as follows:
- Encrypt the string using Blowfish hashing with the
- Run in
compatible mode. A single combined key (eight chars) and salt (two chars)
with no intermediate space are read from standard input and the DES
encrypted result is written to standard output without a terminating
- Hash the string using MD5.
- Prompt for a single string with echo turned off.
- Encrypt the salt with HMAC-SHA1 using the password as key
and the specified rounds as a hint for the number of
- Encrypt the string using DES, with the specified
If no string
is specified, pwhash
one string per line from standard input, encrypting each one with the chosen
algorithm from above. In the event that no specific algorithm is given as a
command line option, the algorithm specified in the default class in
will be used.
For MD5 and Blowfish a new random salt is automatically generated for each
Specifying the string
on the command line should be
discouraged; using the standard input is more secure.