Bump versions.
[gsasl.git] / doc / specification / md5.txt
blobf0d8e4951544e2f732509ea1529156ee8150f1ab
1                        MD5 Based Authentication
2                              Mark Crispin
3                            1 November 1999
6      The IMAP toolkit makes available two MD5 based authentication
7 mechanisms, CRAM-MD5 and APOP.  CRAM-MD5 is described in RFC 2195, and
8 is a SASL (RFC 2222) authentication mechanism.  APOP is described in
9 RFC 1939, the standard document for the POP3 protocol.
11      These mechanisms use the same general idea.  The server issues a
12 challenge; the client responds with an MD5 checksum of the challenge
13 plus the password; the server in compares the client's response with
14 its own calculated value of the checksum.  If the client's response
15 matches the server's calulated value, the client is authenticated.
17      Unlike plaintext passwords, this form of authentication is
18 believed to be secure against the session being monitored; "sniffing"
19 the session will not disclose the password nor will it provide usable
20 information to authenticate in another session without knowing the
21 password.
23      The key disadvantage with this form of authentication is that the
24 server must know a plaintext form of the password.  In traditional
25 UNIX authentication, the server only knows an encrypted form of the
26 password.  Consequently, the authentication database for this form of
27 authentication must be kept strictly confidential; a bad guy who
28 acquires access to this database can access any account in the
29 database.
31      CRAM-MD5 client support is implemented unconditionally; any
32 client application built with the IMAP toolkit will use CRAM-MD5 with
33 any server which advertises CRAM-MD5 SASL support.
35      CRAM-MD5 and APOP server support is implemented if, and only if,
36 the CRAM-MD5 authentication database exists.  By default, the CRAM-MD5
37 authentication database is in a UNIX file called
38         /etc/cram-md5.pwd
39 It is recommended that this file be protected 0400.
41         NOTE: FAILURE TO PROTECT THIS FILE AGAINST UNAUTHORIZED
42         ACCESS WILL COMPROMSE CRAM-MD5 AND APOP AUTHENTICATION
43         FOR ALL USERS LISTED IN THIS DATABASE.
45      If the CRAM-MD5 authentication database exists, then plaintext
46 password authentication (e.g. the LOGIN command) will also use the
47 CRAM-MD5 passwords instead of UNIX passwords.  Alternatively, it is
48 possible to build the IMAP toolkit so that plaintext password
49 authentication is disabled entirely, by using PASSWDTYPE=nul, e.g.
50         make aix PASSWDTYPE=nul
53      The CRAM-MD5 authentication database file consists of a series of
54 text lines, consisting of a UNIX user name, a single tab, and the
55 password.  A line starting with a "#" character is ignored, as are any
56 lines which are not in valid format.  For example:
58 ------------------------------Sample------------------------------
59 # CRAM-MD5 authentication database
60 # Entries are in form <user><tab><password>
61 # Lines starting with "#" are comments
63 bill    hubba-hubba
64 hillary nysenator
65 monica  beret
66 tripp   wired
67 kenstarr        inquisitor
68 reno    waco
69 jessie  thebody
70 billgates       ruleworld
71 ------------------------------Sample------------------------------
73      Every entry in the CRAM-MD5 authentication database must have a
74 corresponding entry in the /etc/passwd file.  It is STRONGLY
75 RECOMMENDED that the CRAM-MD5 password NOT be the same as the
76 /etc/passwd password.  It is permitted for the /etc/passwd password to
77 be disabled; /etc/passwd is just used to get the UID, GID, and home
78 directory information.