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>
18 /* Function Name: RemoveHyphens
19 * Description: Removes all hyphens from the string passed to it.
20 * Arguments: str - the string to remove the hyphes from
24 void RemoveHyphens(char *str)
28 while ((hyphen = strchr(str, '-')))
29 strcpy(hyphen, hyphen + 1);
33 /* Function Name: EncryptMITID
34 * Description: Encrypts an mit ID number.
35 * Arguments: sbuf - the buffer to return the encrypted number in.
36 * idnumber - the id number (string).
37 * first, last - name of the person.
41 void EncryptID(char *sbuf, char *idnumber, char *first, char *last)
45 RemoveHyphens(idnumber);
46 salt[0] = tolower(last[0]);
47 salt[1] = tolower(first[0]);
50 strcpy(sbuf, crypt(&idnumber[2], salt));