the easiest thing to do would be to have the password program read a password from standard input in a loop until it reads EOF. then the bruteforce program would be the parent, create a pipe set, and fork a child that first dup2's the read end of the pipe to stdin and then exec's the password program. then in the bruteforcer you could generate a password and write it to the pipe. however, as mara said this has already been done, much better than you and i could do it.
that said, the easiest thing is never the most efficient. especially since we;re talkin about brute force here, you want an efficient program if it's going to be constantly doing calculations over a long period of time! if you are fixated on using 2 processes, shared memory is at least twice as fast as using a pipe.
|