summaryrefslogtreecommitdiff
path: root/src/lib/libc/crypt
diff options
context:
space:
mode:
authorprovos <>1997-11-05 11:44:49 +0000
committerprovos <>1997-11-05 11:44:49 +0000
commit0a54ff490905a4c6e2eadd36822cd32bb11625f9 (patch)
tree97b1c709003f85dd8abf61b60beb58362f884a94 /src/lib/libc/crypt
parent02c3789d110b4df002e490fad90f42ba0e8f00c3 (diff)
downloadopenbsd-0a54ff490905a4c6e2eadd36822cd32bb11625f9.tar.gz
openbsd-0a54ff490905a4c6e2eadd36822cd32bb11625f9.tar.bz2
openbsd-0a54ff490905a4c6e2eadd36822cd32bb11625f9.zip
explain about MD5 and Blowfish passwords.
Diffstat (limited to 'src/lib/libc/crypt')
-rw-r--r--src/lib/libc/crypt/crypt.361
1 files changed, 56 insertions, 5 deletions
diff --git a/src/lib/libc/crypt/crypt.3 b/src/lib/libc/crypt/crypt.3
index 3e0e59287b..19806bb707 100644
--- a/src/lib/libc/crypt/crypt.3
+++ b/src/lib/libc/crypt/crypt.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: crypt.3,v 1.6 1997/03/31 02:38:44 deraadt Exp $ 1.\" $OpenBSD: crypt.3,v 1.7 1997/11/05 11:44:49 provos Exp $
2.\" 2.\"
3.\" FreeSec: libcrypt 3.\" FreeSec: libcrypt
4.\" 4.\"
@@ -59,15 +59,19 @@ The
59function performs password encryption, based on the 59function performs password encryption, based on the
60.Tn NBS 60.Tn NBS
61Data Encryption Standard (DES). 61Data Encryption Standard (DES).
62Additional code has been added to deter key search attempts. 62Additional code has been added to deter key search attempts and to use
63stronger hashing algorithms.
63The first argument to 64The first argument to
64.Fn crypt 65.Fn crypt
65is a 66is a
66.Dv null Ns -terminated 67.Dv null Ns -terminated
67string, typically a user's typed password. 68string, typically a user's typed password.
68The second is in one of two forms: 69The second is in one of three forms:
69if it begins with an underscore (``_'') then an extended format is used 70if it begins with an underscore (``_'') then an extended format is used
70in interpreting both the key and the setting, as outlined below. 71in interpreting both the key and the setting, as outlined below. If it begins
72with an string character (``$'') and a number then a different algorithm
73is used depending on the number. At the moment a ``$1'' chooses MD5 hashing
74and a ``$2'' chooses Blowfish hashing, see below for more information.
71.Ss Extended crypt: 75.Ss Extended crypt:
72.Pp 76.Pp
73The 77The
@@ -88,6 +92,51 @@ This allows 24 bits for both
88.Fa count 92.Fa count
89and 93and
90.Fa salt . 94.Fa salt .
95.Ss "MD5" crypt:
96.Pp
97For
98.Tn MD5
99crypt the version number,
100.Fa salt
101and the hashed password are separated
102by the ``$'' character. A valid password looks like this:
103.Pp
104``$1$caeiHQwX$hsKqOjrFRRN6K32OWkCBf1''.
105.Pp
106The whole password string is passed as
107.Fa setting
108for interpretation.
109.Ss "Blowfish" crypt:
110.Pp
111The
112.Tn Blowfish
113version of crypt has 128 bits of
114.Fa salt
115in order to make building
116dictionaries of common passwords space consuming. The initial state
117of the
118.Tn Blowfish
119cipher is expanded using the
120.Fa salt
121and the
122.Fa password
123repeating the process a variable number of rounds, which is encoded in
124the password string. The final password entry is created by encrypting
125the string ``OrpheanBeholderScryDoubt'' with the
126.Tn Blowfish
127state 64 times.
128.Pp
129The version number, the logarithm of the number of rounds and
130the concatenation of salt and
131hashed password are separated by the ``$'' character. An encoded ``8''
132would specify 64 rounds.
133A valid password looks like this:
134.Pp
135``$2a$12$eIAq8PR8sIUnJ1HaohxX2O9x9Qlm2vK97LJ5dsXdmB.eXF42qjchC''.
136.Pp
137The whole password string is passed as
138.Fa setting
139for interpretation.
91.Ss "Traditional" crypt: 140.Ss "Traditional" crypt:
92.Pp 141.Pp
93The first 8 bytes of the key are null-padded, and the low-order 7 bits of 142The first 8 bytes of the key are null-padded, and the low-order 7 bits of
@@ -101,7 +150,7 @@ Thus only 12 bits of
101are used. 150are used.
102.Fa count 151.Fa count
103is set to 25. 152is set to 25.
104.Ss Algorithm: 153.Ss DES Algorithm:
105.Pp 154.Pp
106The 155The
107.Fa salt 156.Fa salt
@@ -210,7 +259,9 @@ functions all manipulate the same key space.
210.Sh SEE ALSO 259.Sh SEE ALSO
211.Xr login 1 , 260.Xr login 1 ,
212.Xr passwd 1 , 261.Xr passwd 1 ,
262.Xr blowfish 3 ,
213.Xr getpass 3 , 263.Xr getpass 3 ,
264.Xr md5 3 ,
214.Xr passwd 5 265.Xr passwd 5
215.Sh BUGS 266.Sh BUGS
216The 267The