Name

makekey

Synopsis

makekey

Produces crypt password hashes. This could be used to automatically populate a password database from known passwords, or to make hashes of prospective passwords that could be subjected to cracking attempts before being put into use.

makekey takes no command-line arguments. It accepts a character string on standard input, consisting of an eight-character password combined with a two-character salt, which is used to permute the DES password encryption algorithm. (Use man crypt for more information.) It prints a thirteen-character string to standard output, with the first two characters being the salt, and the other eleven characters being the password hash. The entire string is suitable for use as the password field in a standard Unix /etc/passwd-format file, or as the value of the passwd property in an Open Directory entry for a user employing Basic authentication.

Example

% echo password12 | /usr/libexec/makekey
12CsGd8FRcMSM

Get Mac OS X in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.