Thursday, February 28, 2008

Cryptx 5 Class Structures



This is the proposed structure for the Classes for the new encryption software Cryptx 5 – Codenamed Sideliner. This is discussed here so that we can get some expert opinion about the implementation, so that we can go forward with this project without many problems.

The basic concept is the abstract class ‘DiskFile’. It could have a class for calculating the CRC-32 hash of a file that resides on the disk. ‘DiskFileIn’ and ‘DiskFileOut’ are classes that are derived from ‘DiskFile’. MI (Multiple Inheritance) comes into play as we also apply the AES class for encrypting and decrypting of files.

For encryption process, the object of ‘DiskFileIn’ will be the data / source file and using AES, we write out the encrypted data to the object of ‘DiskFileOut’.

For decryption process, the object of ‘DiskFileIn’ will be the encrypted file and we will try to decrypt it with the given key and the AES algorithm. The output data will be written to the object of ‘DiskFileOut’.

‘LogWriter’ is a special type of ‘DiskFileOut’ that writes out the log file for the processes done by the program.

‘CryptxHeader’ is the class that is used to denote the extra information of the original file. It will contain methods to generate and decode data from headers.

‘Timer’ (‘CTimer’) class will keep track of the timing functions and will be used by the ‘LogWriter’ object.

Okay, these are the specifications that have been put forward. Please give your expert comments......


2 comments:

Angelo said...

When you have a hammer, everything looks like a nail. Inheritance is a pretty powerful OO mechanism but sometimes it may not fit the bill.

In the illustration is 'LogWriter' truly a kind of 'DiskFileOut'? It seems to me that LogWriter should be a singleton (only one object) and you pass this object the information that needs to be written out via its static methods.
The question to be considered is what changes - Behaviour or Data?
Again LogWriter should be a class all of its own simply because the behaviour of the LogFileWriter has nothing to do with how DiskFileOut behaves. It is the data that is provided to the LogFileWriter that matters.

Midhun Harikumar said...

well i thought that the LogWriter as it writes out a log file, and simply that, but takes some formatting duties extra to DiskFileOut, should also use the methods of DiskFileOut to write to the disk file that is the log file ....



Thanks for the response...