3 * Routines to encrypt ID's
5 * (c) Copyright 1988 by the Massachusetts Institute of Technology.
6 * For copying and distribution information, please see the file
10 #include <mit-copyright.h>
15 /* Function Name: RemoveHyphens
16 * Description: Removes all hyphens from the string passed to it.
17 * Arguments: str - the string to remove the hyphes from
27 while ((hyphen = index(str, '-')) != (char *)0)
28 (void) strcpy(hyphen, hyphen + 1);
32 /* Function Name: EncryptMITID
33 * Description: Encrypts an mit ID number.
34 * Arguments: sbuf - the buffer to return the encrypted number in.
35 * idnumber - the id number (string).
36 * first, last - name of the person.
41 EncryptID(sbuf, idnumber, first, last)
42 char *sbuf, *idnumber, *first, *last;
47 RemoveHyphens(idnumber);
48 salt[0] = tolower(last[0]);
49 salt[1] = tolower(first[0]);
52 (void) strcpy(sbuf, crypt(&idnumber[2], salt));