doc: document that 'openssl rand' is cryptographically secure
[openssl.git] / doc / man1 / openssl-passwd.pod.in
1 =pod
2 {- OpenSSL::safe::output_do_not_edit_headers(); -}
3
4 =head1 NAME
5
6 openssl-passwd - compute password hashes
7
8 =head1 SYNOPSIS
9
10 B<openssl passwd>
11 [B<-help>]
12 [B<-crypt>]
13 [B<-1>]
14 [B<-apr1>]
15 [B<-aixmd5>]
16 [B<-5>]
17 [B<-6>]
18 [B<-salt> I<string>]
19 [B<-in> I<file>]
20 [B<-stdin>]
21 [B<-noverify>]
22 [B<-quiet>]
23 [B<-table>]
24 [B<-reverse>]
25 {- $OpenSSL::safe::opt_r_synopsis -}
26 [I<password>]
27
28 =for openssl ifdef crypt
29
30 =head1 DESCRIPTION
31
32 This command computes the hash of a password typed at
33 run-time or the hash of each password in a list.  The password list is
34 taken from the named file for option B<-in>, from stdin for
35 option B<-stdin>, or from the command line, or from the terminal otherwise.
36 The Unix standard algorithm B<-crypt> and the MD5-based BSD password
37 algorithm B<-1>, its Apache variant B<-apr1>, and its AIX variant are
38 available.
39
40 =head1 OPTIONS
41
42 =over 4
43
44 =item B<-help>
45
46 Print out a usage message.
47
48 =item B<-crypt>
49
50 Use the B<crypt> algorithm (default).
51
52 =item B<-1>
53
54 Use the MD5 based BSD password algorithm B<1>.
55
56 =item B<-apr1>
57
58 Use the B<apr1> algorithm (Apache variant of the BSD algorithm).
59
60 =item B<-aixmd5>
61
62 Use the B<AIX MD5> algorithm (AIX variant of the BSD algorithm).
63
64 =item B<-5>
65
66 =item B<-6>
67
68 Use the B<SHA256> / B<SHA512> based algorithms defined by Ulrich Drepper.
69 See L<https://www.akkadia.org/drepper/SHA-crypt.txt>.
70
71 =item B<-salt> I<string>
72
73 Use the specified salt.
74 When reading a password from the terminal, this implies B<-noverify>.
75
76 =item B<-in> I<file>
77
78 Read passwords from I<file>.
79
80 =item B<-stdin>
81
82 Read passwords from B<stdin>.
83
84 =item B<-noverify>
85
86 Don't verify when reading a password from the terminal.
87
88 =item B<-quiet>
89
90 Don't output warnings when passwords given at the command line are truncated.
91
92 =item B<-table>
93
94 In the output list, prepend the cleartext password and a TAB character
95 to each password hash.
96
97 =item B<-reverse>
98
99 When the B<-table> option is used, reverse the order of cleartext and hash.
100
101 {- $OpenSSL::safe::opt_r_item -}
102
103 =back
104
105 =head1 EXAMPLES
106
107   % openssl passwd -crypt -salt xx password
108   xxj31ZMTZzkVA
109
110   % openssl passwd -1 -salt xxxxxxxx password
111   $1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a.
112
113   % openssl passwd -apr1 -salt xxxxxxxx password
114   $apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0
115
116   % openssl passwd -aixmd5 -salt xxxxxxxx password
117   xxxxxxxx$8Oaipk/GPKhC64w/YVeFD/
118
119 =head1 COPYRIGHT
120
121 Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
122
123 Licensed under the Apache License 2.0 (the "License").  You may not use
124 this file except in compliance with the License.  You can obtain a copy
125 in the file LICENSE in the source distribution or at
126 L<https://www.openssl.org/source/license.html>.
127
128 =cut