Task #3 - Code Ninja
Task #3 - Code Ninja
The host detmolder.cs.uni-bonn.de has a special service on port 7331. Write a linux C program that connects to that host and port using the socket API. All data received is to be given to the library provided in the following. The library decodes the data and returns a secret. This secret can be verified using the form on the self-test page.
Note: detmolder.cs.uni-bonn.de can only be reached from within the network of the computer science department. You can test your program either from a machine in one of the CIP pools or via VPN. If you can ping the host but the port seems closed, please contact Martin Lambertz under the given mail address in the questions section.
The decryption function you have to use has the following signature:
u_char *decrypt(u_char *ibuf, int ilen, int *olen);
Its arguments are:
- ibuf [in]: a pointer to the input buffer
- ilen [in]: the input buffer size
- olen [out]: a pointer to an integer variable that will contain the size of the returned output buffer
The function returns a pointer to a buffer with the result (don't forget to free() it).
The codeninja library is available for download from here:
- netsec-codeninja.tar.gz (64 bit version)
- netsec-codeninja32.tar.gz (32 bit version)
Questions
mail to: lambertz@cs.uni-bonn.de
You can verify your code by submitting the decrypted string via the form on the self-test page.