Specification of the program to be written:

 

stdin --> DES [-d] key --> stdout

 

Where:

- DES is to be written in C or Java.

- Input is to be treated as a stream of bytes,

- -d is to mean decryption.

- Both providing the key in hexadecimal and binary format must be possible.

- Output is to be produced as a stream of bytes.

- It is to be properly dealt with if there is no complete block of 64 bits at the end of the input stream.

- Proper diagnostic output in case of usage errors is to be provided.

 

You will have to initialize some tables.

Here is an ASCII file that contains these tables.

You can copy the numerical values and paste them into your program text.

 

Work should be done in pairs.