LAB setup: you need a computer with Linux operating system.
It may be a native Linux running directly on your PC/Laptop or
a Virtual System - e.g. an Ubuntu image inside a VirtualBox.

Download binary files:

	keygen-eng-1
	keygen-eng-2	
	keygen-eng-3	

You may use wget to do this, e.g.:

	wget http://dream.ict.pwr.wroc.pl/engensec/keygen-eng-h

Remember to add executable flag to downloaded files if they are not set already:

	chmod a+x keygen-eng-*

You may run it then with flag -h to see some help.  But generally -
run it under debugger gdb to see what it does and find out what is the
correct password for your userID (which should be your birtday date)

---------------------------

The programs take user name and password and then verify whether this
combination is correct or not.  There is a hidden algorithm in the
program to verify that.  Your task is to find out what is the correct
password for your student id (or your birthdate).  To see how the program
works you can also use test data with uid '0' and password '12345678'.
So if you run the program with this parameters, you should get:

engensec$ ./keygen-eng-h
    ______                      _____              __          __  
   / ____/___  ____ ____  ____ / ___/___  _____   / /   ____ _/ /_ 
  / __/ / __ \/ __ `/ _ \/ __ \\__ \/ _ \/ ___/  / /   / __ `/ __ \
 / /___/ / / / /_/ /  __/ / / /__/ /  __/ /__   / /___/ /_/ / /_/ /
/_____/_/ /_/\__, /\___/_/ /_/____/\___/\___/  /_____/\__,_/_.___/ 
            /____/                                                 

     ******************************
     *** AUTHORIZATION REQUIRED ***
     ******************************

USER: 0
KEY: 12345678
  _____             __    _      __   __
 / ___/__  ___  ___/ /   (_)__  / /  / /
/ (_ / _ \/ _ \/ _  /   / / _ \/ _ \/_/ 
\___/\___/\___/\_,_/ __/ /\___/_.__(_)  
                    |___/               
__  __                                     __
\ \/ /__  __ __  ___  ___ ____ ___ ___ ___/ /
 \  / _ \/ // / / _ \/ _ `(_-<(_-</ -_) _  / 
 /_/\___/\_,_/ / .__/\_,_/___/___/\__/\_,_(_)
              /_/                            

If you reverse-engineer the program correctly, you will find out what
password you need to provide for your user id, to get the above result.

-------

Hints: use gdb (Gnu Debugger) to run the program under debugger control.
In gdb use "run", "step" "stepi", "next", "nexti" or "cont" to proceed
with program execution, "set break" to set breakpoints, and "print" or
"x" instructions to print variables and contents of memory.



