/* Atanas Dimitrov USER5 Homework Assignment #3 CS6900 Dr. Li */ #include #include #include #include "./crypt.h" int main() { //input files FILE *file_ptr1; //dictionary file char message[50]; // word storage char *enc_passwd; char *slt="6d"; int i, j, k,l; //counters etc. file_ptr1=fopen("./user5_dictionary.txt", "r"); //input file //till the end of the file get the new word while(fgets(message, 50, file_ptr1) != NULL) { //get the next word and convert all letters to lowercase for (i=0; message[i]!='\0'; i++) { message[i]=tolower(message[i]); } // check if it is the password if (strcmp(enc_passwd=crypt(message, slt),"6dL/LiLR/7KLs")==0) { printf("%s == %s\n", message, enc_passwd); break; } //clear the word for next time memset(message, 0x0, 50); } //write the average time //close the file fclose(file_ptr1); exit(0); } /* computer == 6dL/LiLR/7KLs USER5's PASS is "computer" */