encrypt - encrypt passwords from the command line or standard input
encrypt [-k] [-b rounds] [-c class] [-m] [-s salt] [-p |
encrypt prints the encrypted form of string to the standard
is mostly useful for encrypting passwords from within
The options are as follows:
-k Run in makekey compatible mode; a single combined
key and salt
are read from standard input and the DES encrypted
written to standard output without a terminating
Encrypt the string using Blowfish hashing with the
Use the cipher type specified in the given user login class. See
login.conf(5) for more information.
-m Encrypt the string using MD5.
-p Prompt for a single string with echo turned off.
Encrypt the string using DES, with the specified
If no string is specified, encrypt reads one string per line
input, encrypting each one with the chosen algorithm
from above. In
the case where no specific algorithm or specific user login
given as a command line option, the algorithm specified in
class in /etc/login.conf will be used.
For MD5 and Blowfish, a new random salt is automatically
Specifying the string on the command line should be discouraged; using
the standard input is more secure.
encrypt first appeared in OpenBSD 1.2.
A makekey command appeared in Version 7 AT&T UNIX.
OpenBSD 3.6 May 18, 1999
[ Back ]