Difference between revisions of "Team:Groningen/Coding"

Line 200: Line 200:
 
}
 
}
 
}
 
}
], currentStage = {idx: -1, data: null, display: null};
+
], currentStage = null;
 
 
 
function advanceStage(prev){
 
function advanceStage(prev){
Line 404: Line 404:
 
 
 
elStage.onclick = function(evt){
 
elStage.onclick = function(evt){
if(currentStage.idx > stages.length){
+
if(!currentStage){
currentStage.idx = -1;
+
currentStage = {idx: -1, data: null, display: null};
currentStage.data = null;
+
currentStage.display = null;
+
 
}
 
}
 
 

Revision as of 10:33, 26 August 2016

CryptoGE®M
Team
Project
Biology
Computing
Human Practice
Acknowledgements

SpyGEM coding

SpyGEM coding & crypting


Message

Key

Formatted

Encoded

Total length: bases

This page demonstrates the encoding and decoding of text messages into DNA, optionally with AES-256 encryption.

Enter a message into the Message field to have it encoded, or enter an encoded message into the Encoded field to have it decoded. The Key field is used for encryption & decryption and the Formatted field shows more details about the message block.

To counter restriction enzymes a sequence of 'A'-bases is inserted whereever the sequence for a restriction-enzyme occurs. When decoding the message these sequences are removed. The length of the substitution sequence is the shortest sequence of 'A' that does not occur in the encoded message.

The encoding requires 4 bases per character.

The fully encoded message block is formatted as follows:

  1. The letters 'Spy': 3 × 4 bases.
  2. Padding: 4 'A' bases.
  3. The length of the restriction-substitutes: 8-bit number (4 bases).
  4. The length of the encoded message: 16-bit number (8 bases).
  5. The checksum of the encoded message: 16-bit number (8 bases).
  6. The message: 4 bases per character.
  7. The letters 'GEM': 3 × 4 bases.

The total overhead is 48 bases and the maximum message length is 65535 characters.

Encryption has an additional 8 characters (48 bases) overhead, regardless of key or message length.

Oop top