Homework 5, "DBtH8T8yNcN0U"

This homework is worth 20 points.

Goals

When you finish this homework you should:

Assignment

Your friend Fred has forgotten his password. He uses the same password on all of his accounts and can't get in anywhere. He really needs his password back and has ask you to help him.

He is running a rather old version of linux on his home machine and has found that the second field in his entry in /etc/passwd is DBtH8T8yNcN0U. He remembers that he only used lower case letters in his password. Fred is sure that his password has only 6 characters.

Your task is to write a program, using only system calls and a thread library, which will discover Fred's password. You may not use pre-computed tables or any other external resource in your program. The program should be called searcher.

Your program should be designed to work with multiple threads. If the command line argument -N n is present, your program should use n additional threads to perform this task. You may split the search space any way you wish. For example, for -N 4 I would start four threads and give each roughly 1/4 of the search space.

You should design your program to run without input or output. The final results should be written to a file. This way you can run the program without remaining logged in. (searcher &).

In addition your program should produce timing results. You should compute and output the time required for your program to complete the computation. This is sort of a "final right of passage" for the class. It requires you to somehow learn how to use the times system call, or some other suggested/newer system call. You must do this with system calls and not with a C++ time library. Make sure that this is well documented and prints out the units of time.

For testing, timing and debugging purposes, you should attempt to find the password "zzzzx" which encrypts to DBDLjTPhWLYM2 and takes considerably less time.

As part of your final submission, you should provide report that indicates the time for your program to find the password "zzzzx" for 1, 2, 4, and 8 threads. If you wish, go as high as 64 threads on euler.

When you are finished submit a tar/zip file containing your code, a Makefile and a README to the D2L assignment folder for this homework.