Monday, December 10, 2007

GU-Cypher's structure : adding algorithms

As you know, GU-Cypher is coded in Java and is still in development. This program will allow encrypting data using a lot of different algorithms. To achieve this, the program has to be modular in order to make the addition of a new algorithm easy. That is why the use of the interface structure from the Java language seems a good idea.

In Java, an interface is a way to define a type of object with a general structure, by only specifying what actions these objects must be able to do. The actual implementation of these actions, that is how they are performed, is specific to each object of that type.

In GU-Cypher, we created an interface called Algorithm which defines what a cryptography algorithm must be able to do: encrypt and decrypt data. This interface will be the starting point for every new algorithm we want to implement. To add a new one to the software, we just have to implement the Algorithm interface and provide the code for the encrypt and decrypt methods.