File: crypt_md5.h

package info (click to toggle)
squid 2.6.5-6etch5
  • links: PTS
  • area: main
  • in suites: etch
  • size: 12,540 kB
  • ctags: 13,801
  • sloc: ansic: 105,278; sh: 6,083; makefile: 1,297; perl: 1,245; awk: 40
file content (18 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * Creates a MD5 based hash of a password
 *
 * To validate a entered password, use the previously calculated
 * password hash as salt, and then compare the result. If identical
 * then the password matches.
 *
 * While encoding a password the salt should be 8 randomly selected
 * characters from the base64 alphabet, for example generated as follows:
 *    char salt[9];
 *    to64(salt, rand(), 4);
 *    to64(salt+4, rand(), 4);
 *    salt[0] = '\0';
 */
char *crypt_md5(const char *pw, const char *salt);

/* MD5 hash without salt */
char *md5sum(const char *s);