From: Vincent Bray mod_authn_alias
can also help in simplifying certain
authentication configurations.
The various ciphers supported by Apache for authentication data are + explained in Password + Encryptions.
+And you may want to look at the Access Control howto, which discusses a number of related topics.
diff --git a/docs/manual/howto/auth.xml b/docs/manual/howto/auth.xml index 36beabc6e66..c9bcc69bf57 100644 --- a/docs/manual/howto/auth.xml +++ b/docs/manual/howto/auth.xml @@ -377,7 +377,11 @@ person in contain some more information about how this all works.The various ciphers supported by Apache for authentication data are + explained in Password + Encryptions.
+And you may want to look at the Access Control howto, which discusses a number of related topics.
diff --git a/docs/manual/misc/index.html.en b/docs/manual/misc/index.html.en index ae5c39dcbf9..f730fd2b0b8 100644 --- a/docs/manual/misc/index.html.en +++ b/docs/manual/misc/index.html.en @@ -67,6 +67,13 @@This document acts as a reference page for most of the relevant standards that Apache follows.
+ +Discussion of the various ciphers supported by Apache for + authentication purposes.
+This document acts as a reference page for most of the relevant standards that Apache follows.
+ +Discussion of the various ciphers supported by Apache for + authentication purposes.
+Apache HTTP Server Version 2.2
+Available Languages: en
+Notes about the password encryption formats generated and understood by + Apache.
+There are four formats that Apache recognizes for basic-authentication + passwords. Note that not all formats work on every platform:
+ +crypt(3)
function
+ with a randomly-generated 32-bit salt (only 12 bits used) and the first 8
+ characters of the password.
+ $ htpasswd -nbm myName myPassword
+ myName:$apr1$r31.....$HqJZimcKQFAMYayBlzkrA/
+
+ $ htpasswd -nbs myName myPassword
+ myName:{SHA}VBPuJHI7uixaa6LQGWx4s+5GKNE=
+
+ $ htpasswd -nbd myName myPassword
+ myName:rqXexS6ZhobKA
+
OpenSSL knows the Apache-specific MD5 algorithm.
+ +
+ $ openssl passwd -apr1 myPassword
+ $apr1$qHDFfhPC$nITSVHgYbDAK1Y0acGRnY0
+
+ openssl passwd -crypt myPassword
+ qQ5vTYO3c8dsU
+
The salt for a CRYPT password is the first two characters (converted to
+ a binary value). To validate myPassword
against
+ rqXexS6ZhobKA
+ $ openssl passwd -crypt -salt rq myPassword
+ Warning: truncating password to 8 characters
+ rqXexS6ZhobKA
+
Note that using myPasswo
instead of
+ myPassword
will produce the same result because only the
+ first 8 characters of CRYPT passwords are considered.
The salt for an MD5 password is between $apr1$
and the
+ following $
(as a Base64-encoded binary value - max 8 chars)
+ To validate myPassword
against
+ $apr1$r31.....$HqJZimcKQFAMYayBlzkrA/
+ $ openssl passwd -apr1 -salt r31..... myPassword
+ $apr1$r31.....$HqJZimcKQFAMYayBlzkrA/
+
The SHA1 variant is probably the most useful format for DBD + authentication. Since the SHA1 and Base64 functions are commonly + available, other software can populate a database with encrypted passwords + that are usable by Apache basic authentication.
+ +To create Apache SHA1-variant basic-authentication passwords in various + languages:
+ +
+ '{SHA}' . base64_encode(sha1($password, TRUE))
+
+ "{SHA}" + new sun.misc.BASE64Encoder().encode(java.security.MessageDigest.getInstance("SHA1").digest(password.getBytes()))
+
+ "{SHA}" & ToBase64(BinaryDecode(Hash(password, "SHA1"), "Hex"))
+
+ require 'digest/sha1'
+ require 'base64'
+ '{SHA}' + Base64.encode64(Digest::SHA1.digest(password))
+
+ Use the APR function: apr_sha1_base64
+
+
+ '{SHA}'||encode(digest(password,'sha1'),'base64')
+
Apache recognizes one format for
+ digest-authentication passwords - the MD5 hash of the string
+ user:realm:password
as a 32-character string of hexadecimal
+ digits. realm
is the Authorization Realm argument to the
+ AuthName
directive in
+ httpd.conf.
Since the MD5 function is commonly available, other software can + populate a database with encrypted passwords that are usable by Apache + digest authentication.
+ +To create Apache digest-authentication passwords in various + languages:
+ +
+ md5($user . ':' . $realm . ':' .$password)
+
+ byte b[] = java.security.MessageDigest.getInstance("MD5").digest( (user + ":" + realm + ":" + password ).getBytes());
+ java.math.BigInteger bi = new java.math.BigInteger(b);
+ String s = bi.toString(16);
+ if (s.length() % 2 != 0)
+
+ s = "0" + s;
+
+ // String s is the encrypted password
+
+ LCase(Hash( (user & ":" & realm & ":" & password) , "MD5"))
+
+ require 'digest/md5'
+ Digest::MD5.hexdigest(user + ':' + realm + ':' + password)
+
+
+ encode(digest( user || ':' || realm || ':' || password , 'md5'), 'hex')
+
Available Languages: en
+Notes about the password encryption formats generated and understood by + Apache.
+There are four formats that Apache recognizes for basic-authentication + passwords. Note that not all formats work on every platform:
+ +crypt(3)
function
+ with a randomly-generated 32-bit salt (only 12 bits used) and the first 8
+ characters of the password.OpenSSL knows the Apache-specific MD5 algorithm.
+ +The salt for a CRYPT password is the first two characters (converted to
+ a binary value). To validate myPassword
against
+ rqXexS6ZhobKA
Note that using myPasswo
instead of
+ myPassword
will produce the same result because only the
+ first 8 characters of CRYPT passwords are considered.
The salt for an MD5 password is between $apr1$
and the
+ following $
(as a Base64-encoded binary value - max 8 chars)
+ To validate myPassword
against
+ $apr1$r31.....$HqJZimcKQFAMYayBlzkrA/
The SHA1 variant is probably the most useful format for DBD + authentication. Since the SHA1 and Base64 functions are commonly + available, other software can populate a database with encrypted passwords + that are usable by Apache basic authentication.
+ +To create Apache SHA1-variant basic-authentication passwords in various + languages:
+ +Apache recognizes one format for
+ digest-authentication passwords - the MD5 hash of the string
+ user:realm:password
as a 32-character string of hexadecimal
+ digits. realm
is the Authorization Realm argument to the
+
Since the MD5 function is commonly available, other software can + populate a database with encrypted passwords that are usable by Apache + digest authentication.
+ +To create Apache digest-authentication passwords in various + languages:
+ +This module manages database connections, in a manner optimised for the platform. On non-threaded platforms,