Open In App
Related Articles

DNA Cryptography

Like Article
Save Article
Report issue

Cryptography is the branch of science which deals with the encoding of information for the purpose of hiding messages. It plays a vital role in the infrastructure of communication security. The Pioneering work had been done by Ashish Gehani et al and Amin et al after Leonard Max Adleman had shown the capability of molecular computation in 1994. This paved the way for DNA Computing. DNA Cryptology combines cryptology and modern biotechnology. 

Why DNA Cryptography? 

  • DNA Cryptography is one of the rapidly evolving technologies in the world. 
  • Adelman showed the world how it can be used to solve complex problems like directed Hamilton path problem and NP-complete problem (for example Travelling Salesman problem). Hence users can design and implement more complex Crypto algorithms. 
  • It brings forward new hope to break unbreakable algorithms. This is because DNA computing offers more speed, minimal storage, and power requirements. 
  • DNA stores memory at a density of about 1 bit/nm3 where conventional storage media requires 1012 nm3/bit. 
  • No power is required for DNA computing while the computation is taking place. 
  • Surprisingly, one gram of DNA contains 1021 DNA bases which are equivalent to 108 TB of data. Hence can store all the data in the world in a few milligrams. 

DNA Cryptography can be defined as hiding data in terms of DNA Sequence. Just like the RSA and DES algorithms, in DNA Cryptology users have DNA algorithms like “Public-key system using DNA as a one-way function for key distribution,” “DNASC cryptography system”, DNA Steganography Systems, Triple stage DNA Cryptography, Encryption algorithm inspired by DNA and Chaotic computing. 

So, how do encode data in a DNA strand which is mainly made, up of 4 nitrogenous bases namely: 

  1. Adenine (A) 
  2. Thymine (T) 
  3. Cytosine (C) 
  4. Guanine (G) 

The easiest way to encode is to represent these four units as four figures: 

A(0) –00
T(1) –01
  • By these encoding rules, there are 4!=24 possible encoding methods. Based on some principles as A and G make pairs while T and C make pairs. 
  • Of those 24 methods, only 8 matches the DNA pairing rule but the best encoding scheme is 0123/CTAG. 

So now converted our initial number into a sequence of A, T, G, and C theoretically. This is then physically implemented using various DNA synthesizing techniques like Chemical Oligonucleotide Synthesis and Oligo Synthesis Platforms (this includes column-based Oligo Synthesis, Array-based Oligo Synthesis, Complex Strand and Gene Synthesis and Error Correction). 

Let’s take an example of the classic XOR One Time Pad and see how its implemented using DNA Cryptography: 

Example – Let M be the message and K be the key. The Ciphertext is obtained by finding M xor K = C. User can again obtain the Encoded message by doing: C xor K = M xor K xor K= M. Hence, get our original message. The steps involved in implementing it is: 

  1. The message and the OTP key are converted to ASCII bits 
  2. Zero Padding is added to the message and the key in order to make the size of their binary codes even 
  3. The message and the key are XORed together 
  4. The XOR output is represented in DNA bases format. This is our enciphered text. 

The decryption process involves the following processes and hence it is also prone to eavesdropping: 

  1. All the DNA bases are transformed into bits. 
  2. These bits are then XORed with the OTP key bits to reproduce the original plain text. 
  3. This text so obtained in binary format is then converted into a sequence of ASCII characters. 

Similarly, users can implement other crypto algorithms like AES and even DES. Instead of storing data as a sequence of 0s and 1s, storing them as a sequence of nitrogenous bases. Storing information in the form of DNA enables us to store a lot of data in a small area. 

Here’s an example of DNA cryptography that demonstrates the encoding and decoding of a message using a simple substitution cipher:


import random
# Define the DNA encoding and decoding dictionaries
encoding_dict = {'A': 'AT', 'T': 'TA', 'C': 'CG', 'G': 'GC'}
decoding_dict = {v: k for k, v in encoding_dict.items()}
# Function to encrypt a message using DNA encoding
def encrypt(message):
    encrypted = ''
    for char in message:
        if char in encoding_dict:
            encrypted += encoding_dict[char]
    return encrypted
# Function to decrypt a DNA-encoded message
def decrypt(encrypted):
    decrypted = ''
    for i in range(0, len(encrypted), 2):
        pair = encrypted[i:i+2]
        if pair in decoding_dict:
            decrypted += decoding_dict[pair]
    return decrypted
# Example usage
message = "HELLO WORLD"
print("Original Message:", message)
# Encryption
encrypted_message = encrypt(message)
print("Encrypted Message:", encrypted_message)
# Decryption
decrypted_message = decrypt(encrypted_message)
print("Decrypted Message:", decrypted_message)


In this example, the encoding_dict and decoding_dict dictionaries represent the mapping between DNA bases and their corresponding letters (A, T, C, G). The ‘encrypt' function takes a message as input and converts each letter to its corresponding DNA base pairs according to the encoding_dict. The ‘decrypt' function takes the DNA-encoded message and converts each DNA base pair back to the original letter using the decoding_dict.

When you run the code, you will see the following output:

Original Message: HELLO WORLD
Decrypted Message: HELLOWORLD

This demonstrates the basic idea of DNA cryptography, where the original message is encrypted using DNA encoding (mapping letters to DNA base pairs) and then decrypted back to the original message by reversing the process.


High level of security: DNA cryptography provides a high level of security due to the complexity of DNA sequences and the difficulty of manipulating and decoding DNA molecules. DNA sequences can be used as cryptographic keys, making them virtually impossible to break using current technology.

Large key space: DNA cryptography allows for a large key space, which can make it more difficult for attackers to find the correct key. The key space can be expanded by using longer DNA sequences or by encoding multiple keys in a single DNA molecule.

Resistance to attacks: DNA cryptography is resistant to certain types of attacks, such as brute-force attacks and quantum computing attacks. This is due to the inherent complexity of DNA sequences and the difficulty of manipulating them.


Technical complexity: DNA cryptography requires specialized knowledge and equipment to encode and decode messages using DNA molecules. This can make it difficult for non-experts to use and implement DNA cryptography in practical applications.

Cost: DNA cryptography can be costly due to the specialized equipment and materials required for encoding and decoding DNA molecules. This can make it less accessible for organizations or individuals with limited resources.

Limited application: DNA cryptography is currently limited to certain niche applications, such as military and intelligence operations, due to the technical complexity and cost involved. It may not be suitable for general-purpose encryption needs, such as secure communication or data storage.

Last Updated : 19 Jul, 2023
Like Article
Save Article
Share your thoughts in the comments
Similar Reads