#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <sys/types.h>
#include <des.h>

/* kerberos string to key print routine. given a passwrd */
/* return the key such that it could be put into a       */
/* kas setkey command for example:                       */
/* kas setkey <user> -new_key `kstk <passwd>` -a <admin> */
/*                                                       */
/* Doug Engert - ANL 9/9/92                              */

main(argc, argv)
int argc;
char **argv; {
 unsigned char tkey[8];
 int j;

 if (argc == 1) {
    printf("kstk usage: kstk passwrd\n");
    exit(1);
        }
 des_string_to_key(argv[1],tkey);

        for(j=0;j<8;j++) {
    if(isalpha(tkey[j]) != 0)printf("%c",tkey[j]);
    else printf("\\%3o",(unsigned char)tkey[j]);
        }
        printf("\n");
 exit(0);
}
