1md5crypt(n)              MD5-based password encryption             md5crypt(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       md5crypt - MD5-based password encryption
9

SYNOPSIS

11       package require Tcl  8.2
12
13       package require md5  2.0
14
15       package require md5crypt  ?1.1.0?
16
17       ::md5crypt::md5crypt password salt
18
19       ::md5crypt::aprcrypt password salt
20
21       ::md5crypt::salt ?length?
22
23______________________________________________________________________________
24

DESCRIPTION

26       This  package  provides  an  implementation  of  the MD5-crypt password
27       encryption algorithm as pioneered by FreeBSD and currently in use as  a
28       replacement  for  the unix crypt(3) function in many modern systems. An
29       implementation of the closely related Apache MD5-crypt is  also  avail‐
30       able.   The  output  of  these commands are compatible with the BSD and
31       OpenSSL implementation of md5crypt and the Apache 2 htpasswd program.
32

COMMANDS

34       ::md5crypt::md5crypt password salt
35              Generate a BSD compatible md5-encoded  password  hash  from  the
36              plaintext password and a random salt (see SALT).
37
38       ::md5crypt::aprcrypt password salt
39              Generate an Apache compatible md5-encoded password hash from the
40              plaintext password and a random salt (see SALT).
41
42       ::md5crypt::salt ?length?
43              Generate a random salt string suitable for use with the md5crypt
44              and aprcrypt commands.
45

SALT

47       The salt passed to either of the encryption schemes implemented here is
48       checked to see if it begins with the  encryption  scheme  magic  string
49       (either  "$1$" for MD5-crypt or "$apr1$" for Apache crypt). If so, this
50       is removed. The remaining characters up to the next $ and up to a maxi‐
51       mum  of  8  characters  are then used as the salt. The salt text should
52       probably be restricted the set of ASCII  alphanumeric  characters  plus
53       "./"  (dot and forward-slash) - this is to preserve maximum compatabil‐
54       ity with the unix password file format.
55
56       If a password is being generated rather than checked  from  a  password
57       file then the salt command may be used to generate a random salt.
58

EXAMPLES

60              % md5crypt::md5crypt password 01234567
61              $1$01234567$b5lh2mHyD2PdJjFfALlEz1
62
63
64
65              % md5crypt::aprcrypt password 01234567
66              $apr1$01234567$IXBaQywhAhc0d75ZbaSDp/
67
68
69
70              % md5crypt::md5crypt password [md5crypt::salt]
71              $1$dFmvyRmO$T.V3OmzqeEf3hqJp2WFcb.
72
73

BUGS, IDEAS, FEEDBACK

75       This  document,  and the package it describes, will undoubtedly contain
76       bugs and other problems.  Please report such in the  category  md5crypt
77       of  the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist].  Please
78       also report any ideas for enhancements you may have for either  package
79       and/or documentation.
80
81       When proposing code changes, please provide unified diffs, i.e the out‐
82       put of diff -u.
83
84       Note further that  attachments  are  strongly  preferred  over  inlined
85       patches.  Attachments  can  be  made  by  going to the Edit form of the
86       ticket immediately after its creation, and  then  using  the  left-most
87       button in the secondary navigation bar.
88

SEE ALSO

90       md5
91

KEYWORDS

93       hashing, md5, md5crypt, message-digest, security
94

CATEGORY

96       Hashes, checksums, and encryption
97
99       Copyright (c) 2003, Pat Thoyts <patthoyts@users.sourceforge.net>
100
101
102
103
104tcllib                               1.1.0                         md5crypt(n)
Impressum