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>
20 /* Function Name: RemoveHyphens
21 * Description: Removes all hyphens from the string passed to it.
22 * Arguments: str - the string to remove the hyphes from
32 while ((hyphen = strchr(str, '-')) != (char *)0)
33 (void) strcpy(hyphen, hyphen + 1);
37 /* Function Name: EncryptMITID
38 * Description: Encrypts an mit ID number.
39 * Arguments: sbuf - the buffer to return the encrypted number in.
40 * idnumber - the id number (string).
41 * first, last - name of the person.
46 EncryptID(sbuf, idnumber, first, last)
47 char *sbuf, *idnumber, *first, *last;
51 RemoveHyphens(idnumber);
52 salt[0] = tolower(last[0]);
53 salt[1] = tolower(first[0]);
56 (void) strcpy(sbuf, crypt(&idnumber[2], salt));