diff -3Nur old/lib/crypto/des/key_lookup.c new/lib/crypto/des/key_lookup.c
--- old/lib/crypto/des/key_lookup.c	Wed Dec 31 19:00:00 1969
+++ new/lib/crypto/des/key_lookup.c	Tue Jul  4 17:19:21 2000
@@ -0,0 +1,122 @@
+#ifdef KRBSC
+// package examples.hello;
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#define BUF_LEN 1024
+
+#ifdef TEST
+int main(int argc, char *argv[])
+{
+
+  /* states:
+     0  match principal name
+     1  match realm name
+     2  get key number
+     3  get PIN
+  */
+#define STATE_PRINC = 0;
+#define STATE_REALM = 1;
+#define STATE_KEY_NUM = 2;
+#define STATE_PIN = 3;
+  /* error code */
+#define SC_SUCCESS = 0;
+#define ERR_ENTRY_NOT_FOUND = 100;
+#define ERR_MULTIPLE_ENTRY_FOUND = 101;
+    
+  // member variables
+  int key_num = 0, rv, fd, file_size;
+  unsigned char *princ, *realm;
+  unsigned char tmp_str[BUF_LEN]; 
+
+  // check option 
+  if (argc < 3) {
+    fprintf (stderr, "key_lookup princ filename\n");
+    return 1; 
+  }
+
+  // printf ("looking for principal %s in file %s.\n", argv[1], argv[2]);
+
+  /* open file */
+  fd = open (argv[2], O_RDONLY);
+  if (fd < 0) {
+    fprintf (stderr, "cannot open %s\n", argv[2]);
+    return 1;
+  }
+
+  /* read file */
+  file_size = read (fd, tmp_str, BUF_LEN);
+  if (file_size < 0) {
+    fprintf (stderr, "cannot read %s\n", argv[2]);
+    return 1;
+  }
+
+  /* call parsing function */
+  key_num = parse_keyfile (argv[1], strlen (argv[1]),
+			   tmp_str, file_size);
+  /*printf ("key_num = %d\n", key_num);*/
+
+  return 0; 
+}
+#endif /* TEST */
+
+/*
+  parse_keyfile() parses the buffer "key_file",
+  finds a corresponding entry of the "princ", 
+  and get the key number.  
+  
+  the format of the key_file:
+  princ@realm         key_number PIN
+  
+  For example, 
+  itoi@CITI.UMICH.EDU 6          1234
+  
+*/
+#define DELIMITER " \t" /* separate tokens */
+
+int parse_keyfile (unsigned char *princ, int princ_len, 
+		   unsigned char *key_file, int key_file_len)
+{
+    unsigned char *token, *fp;
+    int state = 0, i; 
+    unsigned char tmp_str[BUF_LEN], line[BUF_LEN]; 
+    int key_number; 
+
+    fp = key_file;
+    while (*fp != '\0') {
+	i = 0; 
+	while (*fp != '\n') {
+	    line[i] = *fp;
+	    i++; 
+	    fp++;
+	    if (*fp == '\0') goto exit_loop; 
+	}
+	fp++;
+	line[i] = '\0'; 
+	if (line[0] == '#') continue; 
+	/*printf ("%s\n", line);*/
+
+	/* get token */
+	token = strtok (line, DELIMITER);
+	/* check princ name */
+	if (strncasecmp(princ, token, princ_len) == 0) {
+	    token = strtok (NULL, DELIMITER);
+	      /* now token contains the key number */
+	    key_number = atoi (token);
+	    /*printf ("key_number = %d\n", key_number);*/
+	    return key_number; 
+	    break; 
+	} else continue; 
+    }
+ exit_loop:
+    return -1; 
+}
+
+
+#endif /* KRBSC */
