Difference between revisions of "Team:Groningen/Coding"

Line 69: Line 69:
 
</head>
 
</head>
 
<body>
 
<body>
<div id="container">
+
<div class="column full_size">
 
<h1>SpyGEM coding &amp; crypting</h1>
 
<h1>SpyGEM coding &amp; crypting</h1>
<hr class="clear" />
+
<div class="column half_size">
<div id="sec-left">
+
<p><div>
<p><div><!--Sub-coding:
+
<span>
+
<input class="subcode" type="radio" id="code64" name="subcode" value="64" />
+
<label for="code64">Six-four</label>
+
</span>
+
<span>
+
<input class="subcode" type="radio" id="code8" name="subcode" value="8bit" checked />
+
<label for="code8">8-bit</label>
+
</span>
+
<span>
+
<input class="subcode" type="radio" id="codex4" name="subcode" value="ex4" />
+
<label for="codex4">Ex-four</label>
+
</span>
+
<span class="vr">&#8203;</span>-->
+
 
<span>
 
<span>
 
<input type="checkbox" id="crypt" />
 
<input type="checkbox" id="crypt" />
Line 108: Line 94:
 
<p><div id="err"></div></p>
 
<p><div id="err"></div></p>
 
</div>
 
</div>
<div id="sec-right">
+
<div class="column half_size">
 
<p>This page demonstrates the encoding and decoding of text messages
 
<p>This page demonstrates the encoding and decoding of text messages
 
into DNA, optionally with AES-256 encryption.</p>
 
into DNA, optionally with AES-256 encryption.</p>
Line 115: Line 101:
 
The Key field is used for encryption &amp; decryption and the
 
The Key field is used for encryption &amp; decryption and the
 
Formatted field shows more details about the message block.</p>
 
Formatted field shows more details about the message block.</p>
<!--<span class="strike"><p>The encoding uses 6 bits, or 3 bases, per character,
 
so the permitted characters are:</p>
 
<p><ul>
 
<li>digits: <code>'0' - '9'</code>,</li>
 
<li>lower-case letters: <code>'a' - 'z'</code>,</li>
 
<li>upper-case letters: <code>'A' - 'Z'</code>,</li>
 
<li>space: <code>' '</code>, and</li>
 
<li>full-stop: <code>'.'</code>.</li>
 
</ul></p></span>-->
 
<!--<p>Different encodings for the message are possible. Both
 
'Six-four' and 'Ex-four' use 6 bits (3 bases) per character,
 
but are limited in the characters they allow. 'Six-four' allows
 
only upper- and lower-case letters, digits, space and full-stop.
 
'Ex-four' is somewhat experimental and allows more characters
 
(all of ASCII and a few more), but needs 12 bits for some characters,
 
most notably for upper-case.</p>-->
 
 
<p>To counter restriction enzymes a sequence of 'A'-bases is
 
<p>To counter restriction enzymes a sequence of 'A'-bases is
 
inserted whereever the sequence for a restriction-enzyme occurs.
 
inserted whereever the sequence for a restriction-enzyme occurs.

Revision as of 13:41, 22 July 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.