3 * Routines to deal with MIT IDs
5 * Copyright (C) 1988-1998 by the Massachusetts Institute of Technology.
6 * For copying and distribution information, please see the file
10 #include <mit-copyright.h>
22 /* Function Name: RemoveHyphens
23 * Description: Removes all hyphens from the string passed to it.
24 * Arguments: str - the string to remove the hyphes from
28 void RemoveHyphens(char *str)
32 while ((hyphen = strchr(str, '-')))
33 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.
45 void EncryptID(char *sbuf, char *idnumber, char *first, char *last)
49 RemoveHyphens(idnumber);
50 salt[0] = tolower(last[0]);
51 salt[1] = tolower(first[0]);
54 strcpy(sbuf, crypt(&idnumber[2], salt));