1 .\" $NetBSD: pwhash.1,v 1.6 2009/10/15 23:12:53 hubertf Exp $
2 .\" $OpenBSD: encrypt.1,v 1.16 2000/11/09 17:52:07 aaron Exp $
4 .\" Copyright (c) 1996, Jason Downs. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
16 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 .\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
19 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22 .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd hashes passwords from the command line or standard input
42 prints the encrypted form of
44 to the standard output.
45 This is mostly useful for encrypting passwords from within scripts.
47 The options are as follows:
50 Encrypt the string using Blowfish hashing with the specified
56 A single combined key (eight chars) and salt (two chars) with no
57 intermediate space are read from standard input and the DES encrypted
58 result is written to standard output without a terminating newline.
60 Encrypt the string using MD5.
62 Prompt for a single string with echo turned off.
64 Encrypt the salt with HMAC-SHA1 using the password as key and the specified
66 as a hint for the number of iterations.
68 Encrypt the string using DES, with the specified
76 reads one string per line from standard input, encrypting each one
77 with the chosen algorithm from above.
78 In the event that no specific algorithm is given as a command line option,
79 the algorithm specified in the default class in
83 For MD5 and Blowfish a new random salt is automatically generated for each
88 on the command line should be discouraged; using the
89 standard input is more secure.
91 .Bl -tag -width /etc/passwd.conf -compact
92 .It Pa /etc/passwd.conf