/* Atanas Dimitrov USER6 Homework Assignment #3 CS6900 Dr. Li */ #include #include #include "./crypt.h" char password[8]; char letters[]={ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; void decrypt(int var, int length) { int i; char *enc_passwd; if(var==length) { //if this is a complete permutation then compare its encrypted version //with shadow file entry. and display as "password -> encrypted password" pair printf("%s\n", password); if (strcmp(enc_passwd=crypt(password, "vi"), "vi2mW5sahNOyE") == 0) { printf("%s -> ",password); printf ("%s\n", enc_passwd); exit(0); } } else { //creates the next permutation by adding letters recursively for (i=0; i