The Wayback Machine - https://web.archive.org/web/20241001055856/https://www.geeksforgeeks.org/dna-cryptography/
Open In App

DNA Cryptography

Last Updated : 12 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Cryptography is the branch of science that deals with the encoding of information to hide 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 the 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 whereas 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
C(2)–10
G(3)–11
  • 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:

Python
import random

# Define the DNA encoding and decoding dictionaries
encoding_dict = {
    'A': 'AT', 'B': 'TA', 'C': 'CG', 'D': 'GC',
    'E': 'GA', 'F': 'AG', 'G': 'TC', 'H': 'CT',
    'I': 'TG', 'J': 'GT', 'K': 'CA', 'L': 'AC',
    'M': 'TG', 'N': 'GT', 'O': 'CA', 'P': 'AC',
    'Q': 'TA', 'R': 'CG', 'S': 'GC', 'T': 'GA',
    'U': 'AG', 'V': 'TC', 'W': 'CT', 'X': 'TG',
    'Y': 'GT', 'Z': 'CA', ' ': 'AA'
}
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]
        else:
            # If character is not in the encoding_dict, handle it appropriately
            encrypted += 'XX'  # Placeholder for unknown characters
    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]
        else:
            decrypted += '?'  # Placeholder for unknown sequences
    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
Encrypted Message: ATCGCGCGCATGCGATATCGAT
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.

Advantages

  • 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.

Disadvantages

  • 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.

Conclusion

DNA cryptography is a novel topic that offers strict levels of security and storage capacity by mixing cryptographic methods with biological processes. Although its cost and complexity limits, its promise in areas like as data storage and secure communication is encouraging. DNA cryptography may become increasingly common and accessible as technology advances.

Frequently Asked Questions on DNA Cryptography – FAQs

What is DNA cryptography?

DNA cryptography is a method of hiding data in sequences of DNA, leveraging the encoded properties of DNA bases to encrypt data.

How is DNA used in cryptography?

Adenine (A), Thymine (T), Cytosine (C), and Guanine (G) are the four nitrogenous bases that are employed in DNA encryption to encode data. The communications are then encrypted and decrypted by manipulating these sequences.

What are the advantages of DNA cryptography?

The primary benefits are resistance to brute-force and quantum computing assaults, a huge key space, and good security owing to the complexity of DNA.

What are the challenges in implementing DNA cryptography?

The primary obstacles include the expensive cost of specialised equipment, the restricted use in domains like as intelligence and the military, and the technical difficulty of encoding and decoding signals.



Previous Article
Next Article

Similar Reads

Classical Cryptography and Quantum Cryptography
Cryptography is the technique that is used for secure communication between two parties in a public environment where unauthorized users and malicious attackers are present. In cryptography, there are two processes i.e. encryption and decryption performed at the sender and receiver end respectively. Encryption is the process where simple multimedia
7 min read
Program to print DNA sequence
Given the value of n i.e, the number of lobes. Print the double-helix structure of Deoxyribonucleic acid(DNA). Input: n = 8 Output: AT T--A A----T T------A T------A G----C T--A GC CG C--G A----T A------T T------A A----T A--T GC AT C--G T----A C------G C------G T----A G--C AT AT T--A A----T T------A T------A G----C T--A GC Explanation : DNA primaril
9 min read
Find Repeated DNA Sequences
Given a string S which represents DNA sequence, the task is to find all the 10-letter long substring that are repeated more than once. Returning the sequence can be done in any order. DNA sequence is string which consists of the 4 characters A, C, G and T. Examples:Input: S = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"Output: ["AAAAACCCCC", "CCCCCAAAAA"]Exp
2 min read
History of Cryptography
Humans have two basic needs when we take about communication. One is the need to communicate selectively, to communicate and share information. These two basic needs while communicating gave rise to coding and encrypting the messages in such a way that only intended people could have access to the information. The word 'cryptography' originated fro
4 min read
Differences between Classical and Quantum Cryptography
Classical Cryptography: Classical cryptography is based on mathematics and it relies on the computational difficulty of factorizing large number. The security of classical cryptography is based on the high complexity of the mathematical problem for the instance factorization of large number. Quantum Cryptography: Quantum Cryptography is based on ph
1 min read
Bifid Cipher in Cryptography
This cipher technique considered more secure compared to other substitution algorithms reason being it breaks the message apart into two separate streams and then recombines them. It is a combination of the Polybius square with the transposition and uses fractionation to achieve diffusion. This encrypting technique invented by Felin Delastelle. It
4 min read
Cryptography and Network Security Principles
In present day scenario security of the system is the sole priority of any organisation. The main aim of any organisation is to protect their data from attackers. In cryptography, attacks are of two types such as Passive attacks and Active attacks. Passive attacks are those that retrieve information from the system without affecting the system reso
3 min read
Shamir's Secret Sharing Algorithm | Cryptography
Cryptography is a technique of securing information and communications through the use of codes so that only those person for whom the information is intended can understand it and process it. Thus preventing unauthorized access to information. The prefix “crypt” means “hidden” and suffix graphy means “writing”. In this article, a type of cryptogra
7 min read
Fernet (symmetric encryption) using Cryptography module in Python
Cryptography is the practice of securing useful information while transmitting from one computer to another or storing data on a computer. Cryptography deals with the encryption of plaintext into ciphertext and decryption of ciphertext into plaintext. Python supports a cryptography package that helps us encrypt and decrypt data. The fernet module o
3 min read
Password Entropy in Cryptography
Password Entropy is the measure of password strength or how strong the given password is. It is a measure of effectiveness of a password against guessing or brute-force attacks. It decides whether the entered password is common and easily crack-able or not. It is calculated by knowing character set (lower alphabets, upper alphabets, numbers, symbol
3 min read
CAST Algorithm in Cryptography
CAST is a general procedure for creating a family of block ciphers. Individual ciphers have names like CAST-128 and CAST-256. The article focuses on discussing the CAST algorithm in cryptography. What is CAST Algorithm?The CAST algorithm is generally used in IP security and follows the Fiestal structure, as the Fiestal structure divides the plain t
4 min read
Merkle-Damgard Scheme in Cryptography
Pre-requisites: Cryptography and its Types MD scheme(discovered by Ralph Merkle) is used to build collision-resistant cryptographic hash functions from collision-resistant one-way compression functions. It is used in algorithms like SHA-1, SHA-256, etc. This scheme can be divided into two stages: Stage 1: Design a fixed-length, collision-resistant
4 min read
PRG, PRF and PRP in Cryptography
Cryptography is the study and practice of techniques for secure communication in the presence of third parties called adversaries. It deals with developing and analyzing protocols that prevent malicious third parties from retrieving information being shared between two entities thereby following the various aspects of information security. In this
2 min read
What is p-box in Cryptography?
P-boxes are permutation boxes which are usually one of the main components of a modern block cipher. They are also known as D-boxes or diffusion boxes. P-boxes are used in the block cipher called the data encryption standard commonly known as DES in cryptography. In this article, we will look into what are p-boxes, the types of p-boxes, and how to
5 min read
Post Quantum Cryptography in Computer Network
Post-quantum cryptography (PQC), also known as quantum-resistant cryptography, is a branch of cryptography. It is also protected against quantum computer attacks. Quantum computers are a new type of computer that uses the principles of quantum mechanics to carry out calculations. Quantum mechanics is a branch of physics that researches the nature o
5 min read
Cryptography in Wireless Sensor Networks
Wireless Sensor Networks (WSNs) have turned out to be indispensable in diverse programs, along with environmental tracking, healthcare, industrial automation, and clever cities. However, those networks are regularly deployed in hard and potentially opposed environments, making statistics safety a pinnacle precedence. Cryptography, the science of se
6 min read
Cryptography in Industrial Control Systems (ICS)
Cryptography plays a crucial role in securing data and communication in the Industrial Control Systems (ICS) which encompass the technology and processes used to control and automate industrial operations. This article explores the fundamental aspects of the cryptography in context of the ICS ensuring the confidentiality, integrity, and authenticit
2 min read
Vernam Cipher in Cryptography
Vernam Cipher is a method of encrypting alphabetic text. It is one of the Substitution techniques for converting plain text into cipher text. In this mechanism, we assign a number to each character of the Plain-Text, like (a = 0, b = 1, c = 2, ... z = 25). Method to take key: In the Vernam cipher algorithm, we take a key to encrypt the plain text w
6 min read
Visual Cryptography | Introduction
Introduction: Visual cryptography is a method of secure communication that uses images to encrypt secret messages. It operates by splitting an image or text into multiple shares, such that when the shares are overlaid, the original image or text becomes visible. Here is how it works:The original image or text is divided into two or more shares, eac
6 min read
An Overview of Cloud Cryptography
Cloud cryptography is a set of techniques used to secure data stored and processed in cloud computing environments. It provides data privacy, data integrity, and data confidentiality by using encryption and secure key management systems. Common methods used in cloud cryptography include: Symmetric encryption: encrypts and decrypts data using the sa
4 min read
Cryptography in IoT (Internet of Things)
Cryptography plays a vital role in securing information and data through the use of codes that transform the data into an unreadable format without a proper key thus preventing unauthorized access. In simple words, we can say that organizations use cryptography to secure communication channels. What is IoT?The Internet of Things (IoT) describes a n
6 min read
What Should Be the Length of the Symmetric Key in Cryptography?
In cryptography, a message is secured by encrypting it with a certain key and then sending it over the network. The security of the encryption process depends upon the key length. The article focuses on discussing the appropriate key length of the symmetric key in cryptography. What is Key Length?The keys are used to control the operation of a ciph
5 min read
Difference between Cryptography and Cryptology
Cryptography is defined as the study of rules and regulations that protect data from unauthorized access and it is also the study of conversion of plain text to cipher text. On the other hand, Cryptology is the study of the conversion of plain text to ciphertext and vice versa. It is also called the study of encryption and decryption. One major dif
3 min read
Difference between Steganography and Cryptography
Steganography and cryptography are critical components of network security. Network security has emerged as an essential part of today's communication infrastructure. There was an urgent need for network security to protect confidentiality and data integrity. It protects the user against unauthorized access. Steganography hides communication traces
3 min read
How is Cryptography used in Healthcare System?
Data breaches and cyber-attacks are nowadays very common phenomenon and the healthcare industry is the preferred target for cyber attackers due to the reason of having valuable and sensitive information. Cryptography comes in aid by offering standard techniques and algorithms to protect patient data and ensure confidentiality. Electronic health rec
9 min read
Advantages and Disadvantages of Cryptography
Cryptography is a strong tool for keeping the confidentiality, integrity, and authenticity of messages and data in many different systems, Cryptography is all about secured methods of communication and information techniques that are based upon mathematical algorithms to encrypt the messages such that it is not readable by third parties. In this ar
5 min read
Asymmetric Key Cryptography
In asymmetric Key cryptography, there are two keys, also known as key pairs: a public key and a private key. The public key is publicly distributed. Anyone can use this public key to encrypt messages, but only the recipient, who holds the corresponding private key, can decrypt those messages. "Public-key cryptography" is another representation used
12 min read
Symmetric Key Cryptography
Symmetrical Key Cryptography also known as conventional or single-key encryption was the primary method of encryption before the introduction of public key cryptography in the 1970s. In symmetric-key algorithms, the same keys are used for data encryption and decryption. This type of cryptography plays a crucial role in securing data because the sam
11 min read
What is Fingerprint in Cryptography?
A Fingerprint in cryptography is a small key that helps identify a longer public key. Fingerprints are used for key authentication and other cryptographic security measures, resulting in greater efficiency with fewer data volumes. Security certificate systems may require manual key authentication to promote proper security practices. Fingerprinting
5 min read
What is N2 Problem in Cryptography?
The N2 problem emerges as a significant challenge in cryptography, protecting and safeguarding the information is most important. This problem is related to the issues of scalability and it arises when handling large volumes of data and also when processing numerous cryptographic operations at the same time. In this article, we will understand the
8 min read