Software
This article will explain in detail how the software part of CryptoGErM works. To encrypt the message and translate it to DNA we wrote several Javascripts. They are used in the demonstration of our software on the Coding page.
The software is divided into several modules, each in their own file. Every module creates a variable that contains the functionality that it provides. Two of the modules were not written by us, but used under an open source license. The AES module was written by Chris Veness at Movable-Type.co.uk. The CRC implementation was written by Github user chitchcock and published as Github Gist #5112270. All other code was written by us and is licensed under the MIT license.
Encryption & Decryption
For the encryption we don't use the AES
module directly, but
the AES.Ctr
module. AES.Ctr
implements the AES counter mode of
operation. This allows us to encrypt messages of arbitrary length,
rather than a fixed length of 256 bits, which is around 32 letters.
AES counter mode also adds randomness to the message. So the encrypted text is always different, even when the same message is encrypted multiple times. When the message is decrypted these random bits are removed, so the output message is still the same as the input.
The AES module is in aes.js and the counter mode addition is in aes-ctr.js.
DNA
Translation to DNA is done by two modules: DNA
and
EightBit
. The EightBit
module translates
letters into eight-bit numbers: from 0 to 255 and DNA
translates those numbers into DNA sequences.