]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix misleading crypt vs hash terminology in ht* and dbmmanage tools.
authorYann Ylavic <ylavic@apache.org>
Tue, 8 Dec 2020 14:06:16 +0000 (14:06 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 8 Dec 2020 14:06:16 +0000 (14:06 +0000)
What the htpasswd, htdbm and dbmmanage tools do is hashing passwords, not
encrypting them, so fix the terminology in manpages, docs, --help, comments
and function names.

Submitted by: Michele Preziuso <mpreziuso kaosdynamics.com>
Reviewed by: ylavic
Github: closes #153

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884207 13f79535-47bb-0310-9956-ffa450edef68

docs/man/dbmmanage.1
docs/man/htdbm.1
docs/man/htpasswd.1
docs/manual/programs/dbmmanage.xml
docs/manual/programs/htdbm.xml
docs/manual/programs/htpasswd.xml
support/dbmmanage.in
support/htdbm.c
support/htpasswd.c

index fde83b0c1a82e99154db6d27656903e821f538fb..d60e84a810b3cdeb2ad5fbdaa2eeaa2997ddadbc 100644 (file)
@@ -59,7 +59,7 @@ The filename of the DBM format file\&. Usually without the extension \fB\&.db\fR
 The user for which the operations are performed\&. The \fIusername\fR may not contain a colon (\fB:\fR)\&.  
 .TP
 \fB\fIencpasswd\fR\fR
-This is the already encrypted password to use for the \fBupdate\fR and \fBadd\fR commands\&. You may use a hyphen (\fB-\fR) if you want to get prompted for the password, but fill in the fields afterwards\&. Additionally when using the \fBupdate\fR command, a period (\fB\&.\fR) keeps the original password untouched\&.  
+This is the already hashed password to use for the \fBupdate\fR and \fBadd\fR commands\&. You may use a hyphen (\fB-\fR) if you want to get prompted for the password, but fill in the fields afterwards\&. Additionally when using the \fBupdate\fR command, a period (\fB\&.\fR) keeps the original password untouched\&.  
 .TP
 \fB\fIgroup\fR\fR
 A group, which the user is member of\&. A groupname may not contain a colon (\fB:\fR)\&. You may use a hyphen (\fB-\fR) if you don't want to assign the user to a group, but fill in the comment field\&. Additionally when using the \fBupdate\fR command, a period (\fB\&.\fR) keeps the original groups untouched\&.  
@@ -72,13 +72,13 @@ This is the place for your opaque comments about the user, like realname, mailad
  
 .TP
 \fB-d\fR
-crypt encryption (default, except on Win32, Netware)  
+crypt hashing (default, except on Win32, Netware)  
 .TP
 \fB-m\fR
-MD5 encryption (default on Win32, Netware)  
+MD5 hashing (default on Win32, Netware)  
 .TP
 \fB-s\fR
-SHA1 encryption  
+SHA1 hashing  
 .TP
 \fB-p\fR
 plaintext (\fInot recommended\fR)  
@@ -88,7 +88,7 @@ plaintext (\fInot recommended\fR)
  
 .TP
 \fBadd\fR
-Adds an entry for \fIusername\fR to \fIfilename\fR using the encrypted password \fIencpasswd\fR\&. dbmmanage passwords\&.dat add rbowen foKntnEF3KSXA  
+Adds an entry for \fIusername\fR to \fIfilename\fR using the hashed password \fIencpasswd\fR\&. dbmmanage passwords\&.dat add rbowen foKntnEF3KSXA  
 .TP
 \fBadduser\fR
 Asks for a password and then adds an entry for \fIusername\fR to \fIfilename\fR\&. dbmmanage passwords\&.dat adduser krietz  
index 1129ae4c4cf4d539f99d33737d0bada444292669..f0fb710a41ce585824e62e83044e0271ab894e22 100644 (file)
@@ -74,19 +74,19 @@ Create the \fIpasswdfile\fR\&. If \fIpasswdfile\fR already exists, it is rewritt
 Display the results on standard output rather than updating a database\&. This option changes the syntax of the command line, since the \fIpasswdfile\fR argument (usually the first one) is omitted\&. It cannot be combined with the \fB-c\fR option\&.  
 .TP
 \fB-m\fR
-Use MD5 encryption for passwords\&. On Windows and Netware, this is the default\&.  
+Use MD5 hashing for passwords\&. On Windows and Netware, this is the default\&.  
 .TP
 \fB-B\fR
-Use bcrypt encryption for passwords\&. This is currently considered to be very secure\&.  
+Use bcrypt hashing for passwords\&. This is currently considered to be very secure\&.  
 .TP
 \fB-C\fR
-This flag is only allowed in combination with \fB-B\fR (bcrypt encryption)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 31)\&.  
+This flag is only allowed in combination with \fB-B\fR (bcrypt hashing)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 31)\&.  
 .TP
 \fB-d\fR
-Use \fBcrypt()\fR encryption for passwords\&. The default on all platforms but Windows and Netware\&. Though possibly supported by \fBhtdbm\fR on all platforms, it is not supported by the httpd server on Windows and Netware\&. This algorithm is \fBinsecure\fR by today's standards\&.  
+Use \fBcrypt()\fR hashing for passwords\&. The default on all platforms but Windows and Netware\&. Though possibly supported by \fBhtdbm\fR on all platforms, it is not supported by the httpd server on Windows and Netware\&. This algorithm is \fBinsecure\fR by today's standards\&.  
 .TP
 \fB-s\fR
-Use SHA encryption for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.  
+Use SHA hashing for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.  
 .TP
 \fB-p\fR
 Use plaintext passwords\&. Though \fBhtdbm\fR will support creation on all platforms, the httpd daemon will only accept plain text passwords on Windows and Netware\&.  
@@ -110,7 +110,7 @@ The filename of the DBM format file\&. Usually without the extension \fB\&.db\fR
 The username to create or update in \fIpasswdfile\fR\&. If \fIusername\fR does not exist in this file, an entry is added\&. If it does exist, the password is changed\&.  
 .TP
 \fB\fIpassword\fR\fR
-The plaintext password to be encrypted and stored in the DBM file\&. Used only with the \fB-b\fR flag\&.  
+The plaintext password to be hashed and stored in the DBM file\&. Used only with the \fB-b\fR flag\&.  
 .TP
 \fB-T\fIDBTYPE\fR\fR
 Type of DBM file (SDBM, GDBM, DB, or "default")\&.  
@@ -137,7 +137,7 @@ One can usually use the \fBfile\fR program supplied with most Unix systems to se
 .fi
  
 .PP
-Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. If executed on a Windows system, the password will be encrypted using the modified Apache MD5 algorithm; otherwise, the system's \fBcrypt()\fR routine will be used\&. If the file does not exist, \fBhtdbm\fR will do nothing except return an error\&.
+Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. If executed on a Windows system, the password will be hashed using the modified Apache MD5 algorithm; otherwise, the system's \fBcrypt()\fR routine will be used\&. If the file does not exist, \fBhtdbm\fR will do nothing except return an error\&.
  
 .nf
 
@@ -177,13 +177,13 @@ The first line creates a new password database with a temporary placeholder entr
 Web password files such as those managed by \fBhtdbm\fR should \fInot\fR be within the Web server's URI space -- that is, they should not be fetchable with a browser\&.
  
 .PP
-The use of the \fB-b\fR option is discouraged, since when it is used the unencrypted password appears on the command line\&.
+The use of the \fB-b\fR option is discouraged, since when it is used the plaintext password appears on the command line\&.
  
 .PP
 When using the \fBcrypt()\fR algorithm, note that only the first 8 characters of the password are used to form the password\&. If the supplied password is longer, the extra characters will be silently discarded\&.
  
 .PP
-The SHA encryption format does not use salting: for a given password, there is only one encrypted representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
+The SHA hashing format does not use salting: for a given password, there is only one hashed representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
  
 .PP
 The SHA and \fBcrypt()\fR formats are insecure by today's standards\&.
@@ -191,10 +191,10 @@ The SHA and \fBcrypt()\fR formats are insecure by today's standards\&.
 .SH "RESTRICTIONS"
  
 .PP
-On the Windows platform, passwords encrypted with \fBhtdbm\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&.
+On the Windows platform, passwords hashed with \fBhtdbm\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&.
  
 .PP
-The MD5 algorithm used by \fBhtdbm\fR is specific to the Apache software; passwords encrypted using it will not be usable with other Web servers\&.
+The MD5 algorithm used by \fBhtdbm\fR is specific to the Apache software; passwords hashed using it will not be usable with other Web servers\&.
  
 .PP
 Usernames are limited to \fB255\fR bytes and may not include the character \fB:\fR\&.
index d7230d8f7ef428cbb453e387636ec8a419138dbb..4e73cda0b268c6ac27c2f2b67b90bb75710c232b 100644 (file)
@@ -45,10 +45,10 @@ htpasswd \- Manage user files for basic authentication
 \fBhtpasswd\fR is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users\&. If \fBhtpasswd\fR cannot access a file, such as not being able to write to the output file or not being able to read the file in order to update it, it returns an error status and makes no changes\&.
  
 .PP
-Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by \fBhtpasswd\fR\&. This program can only manage usernames and passwords stored in a flat-file\&. It can encrypt and display password information for use in other types of data stores, though\&. To use a DBM database see dbmmanage or htdbm\&.
+Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by \fBhtpasswd\fR\&. This program can only manage usernames and passwords stored in a flat-file\&. It can hash and display password information for use in other types of data stores, though\&. To use a DBM database see dbmmanage or htdbm\&.
  
 .PP
-\fBhtpasswd\fR encrypts passwords using either bcrypt, a version of MD5 modified for Apache, SHA-1, or the system's \fBcrypt()\fR routine\&. SHA-2-based hashes (SHA-256 and SHA-512) are supported for \fBcrypt()\fR\&. Files managed by \fBhtpasswd\fR may contain a mixture of different encoding types of passwords; some user records may have bcrypt or MD5-encrypted passwords while others in the same file may have passwords encrypted with \fBcrypt()\fR\&.
+\fBhtpasswd\fR hashes passwords using either bcrypt, a version of MD5 modified for Apache, SHA-1, or the system's \fBcrypt()\fR routine\&. SHA-2-based hashes (SHA-256 and SHA-512) are supported for \fBcrypt()\fR\&. Files managed by \fBhtpasswd\fR may contain a mixture of different encoding types of passwords; some user records may have bcrypt or MD5-hashed passwords while others in the same file may have passwords hashed with \fBcrypt()\fR\&.
  
 .PP
 This manual page only lists the command line arguments\&. For details of the directives necessary to configure user authentication in httpd see the Apache manual, which is part of the Apache distribution or can be found at http://httpd\&.apache\&.org/\&.
@@ -71,7 +71,7 @@ Create the \fIpasswdfile\fR\&. If \fIpasswdfile\fR already exists, it is rewritt
 Display the results on standard output rather than updating a file\&. This is useful for generating password records acceptable to Apache for inclusion in non-text data stores\&. This option changes the syntax of the command line, since the \fIpasswdfile\fR argument (usually the first one) is omitted\&. It cannot be combined with the \fB-c\fR option\&.  
 .TP
 \fB-m\fR
-Use MD5 encryption for passwords\&. This is the default (since version 2\&.2\&.18)\&.  
+Use MD5 hashing for passwords\&. This is the default (since version 2\&.2\&.18)\&.  
 .TP
 \fB-2\fR
 Use SHA-256 \fBcrypt()\fR based hashes for passwords\&. This is supported on most Unix platforms\&.  
@@ -80,19 +80,19 @@ Use SHA-256 \fBcrypt()\fR based hashes for passwords\&. This is supported on mos
 Use SHA-512 \fBcrypt()\fR based hashes for passwords\&. This is supported on most Unix platforms\&.  
 .TP
 \fB-B\fR
-Use bcrypt encryption for passwords\&. This is currently considered to be very secure\&.  
+Use bcrypt hashing for passwords\&. This is currently considered to be very secure\&.  
 .TP
 \fB-C\fR
-This flag is only allowed in combination with \fB-B\fR (bcrypt encryption)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17)\&.  
+This flag is only allowed in combination with \fB-B\fR (bcrypt hashing)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17)\&.  
 .TP
 \fB-r\fR
 This flag is only allowed in combination with \fB-2\fR or \fB-5\fR\&. It sets the number of hash rounds used for the SHA-2 algorithms (higher is more secure but slower; the default is 5,000)\&.  
 .TP
 \fB-d\fR
-Use \fBcrypt()\fR encryption for passwords\&. This is not supported by the httpd server on Windows and Netware\&. This algorithm limits the password length to 8 characters\&. This algorithm is \fBinsecure\fR by today's standards\&. It used to be the default algorithm until version 2\&.2\&.17\&.  
+Use \fBcrypt()\fR hashing for passwords\&. This is not supported by the httpd server on Windows and Netware\&. This algorithm limits the password length to 8 characters\&. This algorithm is \fBinsecure\fR by today's standards\&. It used to be the default algorithm until version 2\&.2\&.17\&.  
 .TP
 \fB-s\fR
-Use SHA-1 (160-bit) encryption for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.  
+Use SHA-1 (160-bit) hashing for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.  
 .TP
 \fB-p\fR
 Use plaintext passwords\&. Though \fBhtpasswd\fR will support creation on all platforms, the httpd daemon will only accept plain text passwords on Windows and Netware\&.  
@@ -110,7 +110,7 @@ Name of the file to contain the user name and password\&. If \fB-c\fR is given,
 The username to create or update in \fIpasswdfile\fR\&. If \fIusername\fR does not exist in this file, an entry is added\&. If it does exist, the password is changed\&.  
 .TP
 \fB\fIpassword\fR\fR
-The plaintext password to be encrypted and stored in the file\&. Only used with the \fB-b\fR flag\&.  
+The plaintext password to be hashed and stored in the file\&. Only used with the \fB-b\fR flag\&.  
  
 .SH "EXIT STATUS"
  
@@ -126,7 +126,7 @@ The plaintext password to be encrypted and stored in the file\&. Only used with
 .fi
  
 .PP
-Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. The password will be encrypted using the modified Apache MD5 algorithm\&. If the file does not exist, \fBhtpasswd\fR will do nothing except return an error\&.
+Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. The password will be hashed using the modified Apache MD5 algorithm\&. If the file does not exist, \fBhtpasswd\fR will do nothing except return an error\&.
  
 .nf
 
@@ -155,13 +155,13 @@ Web password files such as those managed by \fBhtpasswd\fR should \fInot\fR be w
 This program is not safe as a setuid executable\&. Do \fInot\fR make it setuid\&.
  
 .PP
-The use of the \fB-b\fR option is discouraged, since when it is used the unencrypted password appears on the command line\&.
+The use of the \fB-b\fR option is discouraged, since when it is used the plaintext password appears on the command line\&.
  
 .PP
 When using the \fBcrypt()\fR algorithm, note that only the first 8 characters of the password are used to form the password\&. If the supplied password is longer, the extra characters will be silently discarded\&.
  
 .PP
-The SHA-1 encryption format does not use salting: for a given password, there is only one encrypted representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
+The SHA-1 hashing option does not use salting: for a given password, there is only one hashed representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
  
 .PP
 The SHA-1 and \fBcrypt()\fR formats are insecure by today's standards\&.
@@ -172,10 +172,10 @@ The SHA-2-based \fBcrypt()\fR formats (SHA-256 and SHA-512) are supported on mos
 .SH "RESTRICTIONS"
  
 .PP
-On the Windows platform, passwords encrypted with \fBhtpasswd\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&.
+On the Windows platform, passwords hashed with \fBhtpasswd\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&.
  
 .PP
-The MD5 algorithm used by \fBhtpasswd\fR is specific to the Apache software; passwords encrypted using it will not be usable with other Web servers\&.
+The MD5 algorithm used by \fBhtpasswd\fR is specific to the Apache software; passwords hashed using it will not be usable with other Web servers\&.
  
 .PP
 Usernames are limited to \fB255\fR bytes and may not include the character \fB:\fR\&.
index b40fbe0d9f5ebe95ab318637fcee90292a4da701..86985512a019e3af905a373f46d93fb33b8577eb 100644 (file)
@@ -73,7 +73,7 @@
     may not contain a colon (<code>:</code>).</dd>
 
     <dt><code><var>encpasswd</var></code></dt>
-    <dd>This is the already encrypted password to use for the
+    <dd>This is the already hashed password to use for the
     <code>update</code> and <code>add</code> commands. You may use a hyphen
     (<code>-</code>) if you want to get prompted for the password, but fill
     in the fields afterwards. Additionally when using the <code>update</code>
     <section id="options.encodings"><title>Encodings</title>
       <dl>
       <dt><code>-d</code></dt>
-      <dd>crypt encryption (default, except on Win32, Netware)</dd>
+      <dd>crypt hashing (default, except on Win32, Netware)</dd>
 
       <dt><code>-m</code></dt>
-      <dd>MD5 encryption (default on Win32, Netware)</dd>
+      <dd>MD5 hashing (default on Win32, Netware)</dd>
 
       <dt><code>-s</code></dt>
-      <dd>SHA1 encryption</dd>
+      <dd>SHA1 hashing</dd>
 
       <dt><code>-p</code></dt>
       <dd>plaintext (<em>not recommended</em>)</dd>
       <dl>
       <dt><code>add</code></dt>
       <dd>Adds an entry for <var>username</var> to <var>filename</var> using the
-      encrypted password <var>encpasswd</var>.
+      hashed password <var>encpasswd</var>.
 
       <example>dbmmanage passwords.dat add rbowen foKntnEF3KSXA</example>
       </dd>
index 19b90d7b6db9b304a45886c62fa281ee1c297d0a..dcd6ccb7d7f94ca326bac02b2a76e960eb19464e 100644 (file)
     cannot be combined with the <code>-c</code> option.</dd>
 
     <dt><code>-m</code></dt>
-    <dd>Use MD5 encryption for passwords. On Windows and Netware, this is
+    <dd>Use MD5 hashing for passwords. On Windows and Netware, this is
     the default.</dd>
 
     <dt><code>-B</code></dt>
-    <dd>Use bcrypt encryption for passwords. This is currently considered to
+    <dd>Use bcrypt hashing for passwords. This is currently considered to
     be very secure.</dd>
 
     <dt><code>-C</code></dt>
     <dd>This flag is only allowed in combination with <code>-B</code> (bcrypt
-    encryption). It sets the computing time used for the bcrypt algorithm
+    hashing). It sets the computing time used for the bcrypt algorithm
     (higher is more secure but slower, default: 5, valid: 4 to 31).</dd>
 
     <dt><code>-d</code></dt>
-    <dd>Use <code>crypt()</code> encryption for passwords. The default on all
+    <dd>Use <code>crypt()</code> hashing for passwords. The default on all
     platforms but Windows and Netware. Though possibly supported by
     <code>htdbm</code> on all platforms, it is not supported by the
     <program>httpd</program> server on Windows and Netware.
     This algorithm is <strong>insecure</strong> by today's standards.</dd>
 
     <dt><code>-s</code></dt>
-    <dd>Use SHA encryption for passwords. Facilitates migration from/to Netscape
+    <dd>Use SHA hashing for passwords. Facilitates migration from/to Netscape
     servers using the LDAP Directory Interchange Format (ldif).
     This algorithm is <strong>insecure</strong> by today's standards.</dd>
 
     does exist, the password is changed.</dd>
 
     <dt><code><var>password</var></code></dt>
-    <dd>The plaintext password to be encrypted and stored in the DBM file.
+    <dd>The plaintext password to be hashed and stored in the DBM file.
     Used only with the <code>-b</code> flag.</dd>
 
     <dt><code>-T<var>DBTYPE</var></code></dt>
 
     <p>Adds or modifies the password for user <code>jsmith</code>. The user
     is prompted for the password. If executed on a Windows system, the password
-    will be encrypted using the  modified Apache MD5 algorithm; otherwise, the
+    will be hashed using the  modified Apache MD5 algorithm; otherwise, the
     system's <code>crypt()</code> routine will be used. If the file does not
     exist, <code>htdbm</code> will do nothing except return an error.</p>
 
     not be fetchable with a browser.</p>
 
     <p>The use of the <code>-b</code> option is discouraged, since when it is
-    used the unencrypted password appears on the command line.</p>
+    used the plaintext password appears on the command line.</p>
 
     <p>When using the <code>crypt()</code> algorithm, note that only the first
     8 characters of the password are used  to form the password. If the supplied
     password is longer, the extra characters will be silently discarded.</p>
 
-    <p>The SHA encryption format does not use salting: for a given password,
-    there is only one encrypted representation. The <code>crypt()</code> and
+    <p>The SHA hashing option does not use salting: for a given password,
+    there is only one hashed representation. The <code>crypt()</code> and
     MD5 formats permute the representation by prepending a random salt string,
     to make dictionary attacks against the passwords more difficult.</p>
 
 </section>
 
 <section id="restrictions"><title>Restrictions</title>
-    <p>On the Windows platform, passwords encrypted with
+    <p>On the Windows platform, passwords hashed with
     <code>htdbm</code> are limited to no more than <code>255</code>
     characters in length. Longer passwords will be truncated to 255
     characters.</p>
 
     <p>The MD5 algorithm used by <code>htdbm</code> is specific to the Apache
-    software; passwords encrypted using it will not be usable with other Web
+    software; passwords hashed using it will not be usable with other Web
     servers.</p>
 
     <p>Usernames are limited to <code>255</code> bytes and may not include the
index 7777a8b4e3375e2de5098c66ca48948f5aac664e..b52239898c2445d75c5f65ca7dcc4223ce2b8c14 100644 (file)
     <p>Resources available from the Apache HTTP server can be restricted to
     just the users listed in the files created by <code>htpasswd</code>. This
     program can only manage usernames and passwords stored in a flat-file. It
-    can encrypt and display password information for use in other types of data
+    can hash and display password information for use in other types of data
     stores, though. To use a DBM database see <program>dbmmanage</program> or
     <program>htdbm</program>.</p>
 
-    <p><code>htpasswd</code> encrypts passwords using either bcrypt, a
+    <p><code>htpasswd</code> hashes passwords using either bcrypt, a
     version of MD5 modified for Apache, SHA-1, or the system's
     <code>crypt()</code> routine. SHA-2-based hashes (SHA-256 and
     SHA-512) are supported for <code>crypt()</code>.  Files managed by
     <code>htpasswd</code> may contain a mixture of different encoding
     types of passwords; some user records may have bcrypt or
-    MD5-encrypted passwords while others in the same file may have
-    passwords encrypted with <code>crypt()</code>.</p>
+    MD5-hashed passwords while others in the same file may have
+    passwords hashed with <code>crypt()</code>.</p>
 
     <p>This manual page only lists the command line arguments. For details of
     the directives necessary to configure user authentication in
@@ -140,7 +140,7 @@ distribution.</seealso>
     one) is omitted. It cannot be combined with the <code>-c</code> option.</dd>
 
     <dt><code>-m</code></dt>
-    <dd>Use MD5 encryption for passwords. This is the default (since version
+    <dd>Use MD5 hashing for passwords. This is the default (since version
     2.2.18).</dd>
 
     <dt><code>-2</code></dt>
@@ -152,12 +152,12 @@ distribution.</seealso>
     supported on most Unix platforms.</dd>
 
     <dt><code>-B</code></dt>
-    <dd>Use bcrypt encryption for passwords. This is currently considered to
+    <dd>Use bcrypt hashing for passwords. This is currently considered to
     be very secure.</dd>
 
     <dt><code>-C</code></dt>
     <dd>This flag is only allowed in combination with <code>-B</code> (bcrypt
-    encryption). It sets the computing time used for the bcrypt algorithm
+    hashing). It sets the computing time used for the bcrypt algorithm
     (higher is more secure but slower, default: 5, valid: 4 to 17).</dd>
 
     <dt><code>-r</code></dt>
@@ -167,14 +167,14 @@ distribution.</seealso>
     5,000).</dd>
 
     <dt><code>-d</code></dt>
-    <dd>Use <code>crypt()</code> encryption for passwords. This is not
+    <dd>Use <code>crypt()</code> hashing for passwords. This is not
     supported by the <program>httpd</program> server on Windows and
     Netware. This algorithm limits the password length to 8 characters.
     This algorithm is <strong>insecure</strong> by today's standards.
     It used to be the default algorithm until version 2.2.17.</dd>
 
     <dt><code>-s</code></dt>
-    <dd>Use SHA-1 (160-bit) encryption for passwords. Facilitates migration
+    <dd>Use SHA-1 (160-bit) hashing for passwords. Facilitates migration
     from/to Netscape servers using the LDAP Directory Interchange
     Format (ldif).  This algorithm is <strong>insecure</strong> by
     today's standards.</dd>
@@ -204,7 +204,7 @@ distribution.</seealso>
     does exist, the password is changed.</dd>
 
     <dt><code><var>password</var></code></dt>
-    <dd>The plaintext password to be encrypted and stored  in the file. Only
+    <dd>The plaintext password to be hashed and stored  in the file. Only
     used with the <code>-b</code> flag.</dd>
     </dl>
 </section>
@@ -229,7 +229,7 @@ distribution.</seealso>
     </example>
 
     <p>Adds or modifies the password for user <code>jsmith</code>. The user
-    is prompted for the password. The password will be encrypted using the
+    is prompted for the password. The password will be hashed using the
     modified Apache MD5 algorithm. If the file does not exist,
     <code>htpasswd</code> will do nothing except return an error.</p>
 
@@ -260,14 +260,14 @@ distribution.</seealso>
     setuid.</p>
 
     <p>The use of the <code>-b</code> option is discouraged, since when it is
-    used the unencrypted password appears on the command line.</p>
+    used the plaintext password appears on the command line.</p>
 
     <p>When using the <code>crypt()</code> algorithm, note that only the first
     8 characters of the password are used  to form the password. If the supplied
     password is longer, the extra characters will be silently discarded.</p>
 
-    <p>The SHA-1 encryption format does not use salting: for a given
-    password, there is only one encrypted representation. The
+    <p>The SHA-1 hashing format does not use salting: for a given
+    password, there is only one hashed representation. The
     <code>crypt()</code> and MD5 formats permute the representation by
     prepending a random salt string, to make dictionary attacks
     against the passwords more difficult.</p>
@@ -283,13 +283,13 @@ distribution.</seealso>
 </section>
 
 <section id="restrictions"><title>Restrictions</title>
-    <p>On the Windows platform, passwords encrypted with
+    <p>On the Windows platform, passwords hashed with
     <code>htpasswd</code> are limited to no more than <code>255</code>
     characters in length. Longer passwords will be truncated to 255
     characters.</p>
 
     <p>The MD5 algorithm used by <code>htpasswd</code> is specific to the Apache
-    software; passwords encrypted using it will not be usable with other Web
+    software; passwords hashed using it will not be usable with other Web
     servers.</p>
 
     <p>Usernames are limited to <code>255</code> bytes and may not include the
index 2dd8c8679ba359b32b8d3551caa352e918a717ae..881d2301adb4e2170b8bcf22ddbfcd989828c11d 100644 (file)
@@ -32,9 +32,9 @@ sub usage {
     die <<SYNTAX;
 Usage: dbmmanage [enc] dbname command [username [pw [group[,group] [comment]]]]
 
-    where enc is  -d for crypt encryption (default except on Win32, Netware)
-                  -m for MD5 encryption (default on Win32, Netware)
-                  -s for SHA1 encryption
+    where enc is  -d for crypt hashing (default except on Win32, Netware)
+                  -m for MD5 hashing (default on Win32, Netware)
+                  -s for SHA1 hashing
                   -p for plaintext
 
     command is one of: $cmds
@@ -48,7 +48,7 @@ Usage: dbmmanage [enc] dbname command [username [pw [group[,group] [comment]]]]
 SYNTAX
 }
 
-sub need_sha1_crypt {
+sub need_sha1_hash {
     if (!eval ('require "Digest/SHA1.pm";')) {
         print STDERR <<SHAERR;
 dbmmanage SHA1 passwords require the interface or the module Digest::SHA1
@@ -56,21 +56,21 @@ available from CPAN:
 
     http://www.cpan.org/modules/by-module/Digest/Digest-MD5-2.12.tar.gz
 
-Please install Digest::SHA1 and try again, or use a different crypt option:
+Please install Digest::SHA1 and try again, or use a different hashing option:
 
 SHAERR
         usage();
     }
 }
 
-sub need_md5_crypt {
+sub need_md5_hash {
     if (!eval ('require "Crypt/PasswdMD5.pm";')) {
         print STDERR <<MD5ERR;
 dbmmanage MD5 passwords require the module Crypt::PasswdMD5 available from CPAN
 
     http://www.cpan.org/modules/by-module/Crypt/Crypt-PasswdMD5-1.1.tar.gz
 
-Please install Crypt::PasswdMD5 and try again, or use a different crypt option:
+Please install Crypt::PasswdMD5 and try again, or use a different hashing option:
 
 MD5ERR
         usage();
@@ -93,10 +93,10 @@ my $newstyle_salt = $^O =~ /(?:$newstyle_salt_platforms)/;
 my $crypt_not_supported_platforms = join '|', qw{MSWin32 NetWare}; #others?
 my $crypt_not_supported = $^O =~ /(?:$crypt_not_supported_platforms)/;
 
-my $crypt_method = "crypt";
+my $hash_method = "crypt";
 
 if ($crypt_not_supported) {
-    $crypt_method = "md5";
+    $hash_method = "md5";
 }
 
 # Some platforms won't jump through our favorite hoops
@@ -105,7 +105,7 @@ my $not_unix_platforms = join '|', qw{MSWin32 NetWare}; #others?
 my $not_unix = $^O =~ /(?:$not_unix_platforms)/;
 
 if ($crypt_not_supported) {
-    $crypt_method = "md5";
+    $hash_method = "md5";
 }
 
 if (@ARGV[0] eq "-d") {
@@ -114,12 +114,12 @@ if (@ARGV[0] eq "-d") {
         print STDERR
               "Warning: Apache/$^O does not support crypt()ed passwords!\n\n";
     }
-    $crypt_method = "crypt";
+    $hash_method = "crypt";
 }
 
 if (@ARGV[0] eq "-m") {
     shift @ARGV;
-    $crypt_method = "md5";
+    $hash_method = "md5";
 }
 
 if (@ARGV[0] eq "-p") {
@@ -128,20 +128,20 @@ if (@ARGV[0] eq "-p") {
         print STDERR
               "Warning: Apache/$^O does not support plaintext passwords!\n\n";
     }
-    $crypt_method = "plain";
+    $hash_method = "plain";
 }
 
 if (@ARGV[0] eq "-s") {
     shift @ARGV;
-    need_sha1_crypt();
-    $crypt_method = "sha1";
+    need_sha1_hash();
+    $hash_method = "sha1";
 }
 
-if ($crypt_method eq "md5") {
-    need_md5_crypt();
+if ($hash_method eq "md5") {
+    need_md5_hash();
 }
 
-my($file,$command,$key,$crypted_pwd,$groups,$comment) = @ARGV;
+my($file,$command,$key,$hashed_pwd,$groups,$comment) = @ARGV;
 
 usage() unless $file and $command and defined &{$dbmc::{$command}};
 
@@ -188,7 +188,7 @@ sub saltpw_crypt {
         randchar(2);
 }
 
-sub cryptpw_crypt {
+sub hashpw_crypt {
     my ($pw, $salt) = @_;
     $salt = saltpw_crypt unless $salt;
     crypt $pw, $salt;
@@ -199,24 +199,24 @@ sub saltpw_md5 {
     randchar(8);
 }
 
-sub cryptpw_md5 {
+sub hashpw_md5 {
     my($pw, $salt) = @_;
     $salt = saltpw_md5 unless $salt;
     Crypt::PasswdMD5::apache_md5_crypt($pw, $salt);
 }
 
-sub cryptpw_sha1 {
+sub hashpw_sha1 {
     my($pw, $salt) = @_;
     '{SHA}' . Digest::SHA1::sha1_base64($pw) . "=";
 }
 
-sub cryptpw {
-    if ($crypt_method eq "md5") {
-        return cryptpw_md5(@_);
-    } elsif ($crypt_method eq "sha1") {
-        return cryptpw_sha1(@_);
-    } elsif ($crypt_method eq "crypt") {
-        return cryptpw_crypt(@_);
+sub hashpw {
+    if ($hash_method eq "md5") {
+        return hashpw_md5(@_);
+    } elsif ($hash_method eq "sha1") {
+        return hashpw_sha1(@_);
+    } elsif ($hash_method eq "crypt") {
+        return hashpw_crypt(@_);
     }
     @_[0]; # otherwise return plaintext
 }
@@ -243,10 +243,10 @@ sub getpass {
 
 sub dbmc::update {
     die "Sorry, user `$key' doesn't exist!\n" unless $DB{$key};
-    $crypted_pwd = (split /:/, $DB{$key}, 3)[0] if $crypted_pwd eq '.';
+    $hashed_pwd = (split /:/, $DB{$key}, 3)[0] if $hashed_pwd eq '.';
     $groups = (split /:/, $DB{$key}, 3)[1] if !$groups || $groups eq '.';
     $comment = (split /:/, $DB{$key}, 3)[2] if !$comment || $comment eq '.';
-    if (!$crypted_pwd || $crypted_pwd eq '-') {
+    if (!$hashed_pwd || $hashed_pwd eq '-') {
         dbmc->adduser;
     }
     else {
@@ -255,23 +255,23 @@ sub dbmc::update {
 }
 
 sub dbmc::add {
-    die "Can't use empty password!\n" unless $crypted_pwd;
+    die "Can't use empty password!\n" unless $hashed_pwd;
     unless($is_update) {
         die "Sorry, user `$key' already exists!\n" if $DB{$key};
     }
     $groups = '' if $groups eq '-';
     $comment = '' if $comment eq '-';
     $groups .= ":" . $comment if $comment;
-    $crypted_pwd .= ":" . $groups if $groups;
-    $DB{$key} = $crypted_pwd;
+    $hashed_pwd .= ":" . $groups if $groups;
+    $DB{$key} = $hashed_pwd;
     my $action = $is_update ? "updated" : "added";
-    print "User $key $action with password encrypted to $DB{$key} using $crypt_method\n";
+    print "User $key $action with password hashed to $DB{$key} using $hash_method\n";
 }
 
 sub dbmc::adduser {
     my $value = getpass "New password:";
     die "They don't match, sorry.\n" unless getpass("Re-type new password:") eq $value;
-    $crypted_pwd = cryptpw $value;
+    $hashed_pwd = hashpw $value;
     dbmc->add;
 }
 
@@ -289,23 +289,23 @@ sub dbmc::check {
     my $chkpass = (split /:/, $DB{$key}, 3)[0];
     my $testpass = getpass();
     if (substr($chkpass, 0, 6) eq '$apr1$') {
-        need_md5_crypt;
-        $crypt_method = "md5";
+        need_md5_hash;
+        $hash_method = "md5";
     } elsif (substr($chkpass, 0, 5) eq '{SHA}') {
-        need_sha1_crypt;
-        $crypt_method = "sha1";
+        need_sha1_hash;
+        $hash_method = "sha1";
     } elsif (length($chkpass) == 13 && $chkpass ne $testpass) {
-        $crypt_method = "crypt";
+        $hash_method = "crypt";
     } else {
-        $crypt_method = "plain";
+        $hash_method = "plain";
     }
-    print $crypt_method . (cryptpw($testpass, $chkpass) eq $chkpass
-                           ? " password ok\n" : " password mismatch\n");
+    print $hash_method . (hashpw($testpass, $chkpass) eq $chkpass
+                          ? " password ok\n" : " password mismatch\n");
 }
 
 sub dbmc::import {
     while(defined($_ = <STDIN>) and chomp) {
-        ($key,$crypted_pwd,$groups,$comment) = split /:/, $_, 4;
+        ($key,$hashed_pwd,$groups,$comment) = split /:/, $_, 4;
         dbmc->add;
     }
 }
index 40a3d232938a28030881135d5e084a0e53ce4100..c2f8f3f01a78134baf519e79a971f548e715da89 100644 (file)
@@ -290,13 +290,13 @@ static void htdbm_usage(void)
         "   -n   Don't update database; display results on stdout.\n"
         "   -b   Use the password from the command line rather than prompting for it.\n"
         "   -i   Read password from stdin without verification (for script usage).\n"
-        "   -m   Force MD5 encryption of the password (default).\n"
-        "   -B   Force BCRYPT encryption of the password (very secure).\n"
+        "   -m   Force MD5 hashing of the password (default).\n"
+        "   -B   Force BCRYPT hashing of the password (very secure).\n"
         "   -C   Set the computing time used for the bcrypt algorithm\n"
         "        (higher is more secure but slower, default: %d, valid: 4 to 31).\n"
-        "   -d   Force CRYPT encryption of the password (8 chars max, insecure).\n"
-        "   -s   Force SHA encryption of the password (insecure).\n"
-        "   -p   Do not encrypt the password (plaintext, insecure).\n"
+        "   -d   Force CRYPT hashing of the password (8 chars max, insecure).\n"
+        "   -s   Force SHA hashing of the password (insecure).\n"
+        "   -p   Do not hash the password (plaintext, insecure).\n"
         "   -T   DBM Type (SDBM|GDBM|DB|default).\n"
         "   -l   Display usernames from database on stdout.\n"
         "   -v   Verify the username/password.\n"
index f17d9923e1879ea234526978ccab8b2bf8d55fed..2bb6d08247b3a0647f1877ee8e4e5dc72699ead3 100644 (file)
@@ -108,17 +108,17 @@ static void usage(void)
         " -b  Use the password from the command line rather than prompting "
             "for it." NL
         " -i  Read password from stdin without verification (for script usage)." NL
-        " -m  Force MD5 encryption of the password (default)." NL
-        " -2  Force SHA-256 crypt() hash of the password (secure)." NL
-        " -5  Force SHA-512 crypt() hash of the password (secure)." NL
-        " -B  Force bcrypt encryption of the password (very secure)." NL
+        " -m  Force MD5 hashing of the password (default)." NL
+        " -2  Force SHA-256 hashing of the password (secure)." NL
+        " -5  Force SHA-512 hashing of the password (secure)." NL
+        " -B  Force bcrypt hashing of the password (very secure)." NL
         " -C  Set the computing time used for the bcrypt algorithm" NL
         "     (higher is more secure but slower, default: %d, valid: 4 to 17)." NL
         " -r  Set the number of rounds used for the SHA-256, SHA-512 algorithms" NL
         "     (higher is more secure but slower, default: 5000)." NL
-        " -d  Force CRYPT encryption of the password (8 chars max, insecure)." NL
-        " -s  Force SHA-1 encryption of the password (insecure)." NL
-        " -p  Do not encrypt the password (plaintext, insecure)." NL
+        " -d  Force CRYPT hashing of the password (8 chars max, insecure)." NL
+        " -s  Force SHA-1 hashing of the password (insecure)." NL
+        " -p  Do not hash the password (plaintext, insecure)." NL
         " -D  Delete the specified user." NL
         " -v  Verify password for the specified user." NL
         "On other systems than Windows and NetWare the '-p' flag will "