Tags

, , ,

Since last week, I’ve been working on a Software implementation for the Data Encryption Standard. I know that it is obsolete, but as you know, several of my programs are made for scholarship work. This time the task were to take the source of GnuPG, find the DES code in there, and modify it to make it work with CBC and CTR operation modes. The theoretical basis for DES can be checked on FIPS 46-3.

The operation modes for this DES implementation covers the next diagrams:

DES in Electronic Code Book mode:

Data Encryption Standar in Electronic Code Book modeDES in Cipher Block Chaining (1st block):

Data Encryption Standard in Cipher Block Chaining mode (1st block)

DES in Cipher Block Chaining (2nd to n-th block):Data Encryption Standard in Cipher Block Chaining (2nd to n-th block)

DES in Counter mode:

Data Encryption Standard in Counter mode

So, once I have found the DES source, cleaned up the dependencies and setting it to work stand-alone, I wrote the code in C++ and made it a library for working, and guess what? I’m gonna share it with you, the codes are uploaded to des.cc and des.h. The original code it’s still in there, I just added a new methods and modify the code to get a step-by-step view of the process, you just need to extract the values in the variables ip (for the initial permutation), fp (for the final permutation), ronda[] (for the sixteen rounds of the fesitel function, xor and reverse the left and right blocks), additionally variable called xorr (for the xor functions in CBC and CTR operation modes.

The last task from that practice were to make a graphic user interface for the new library. I’ve been working in wxWidgets libraries for C++ and Ruby, naturally I made the GUI with that library and result in a multi platform program, there’s just a little issue, I haven’t compiled it on Windows yet, so there is one program for linux and this is it:

<wait… in Windows I don’t  have the f*cking software… uh you’ll have to wait until I get it from my Linux partition>