Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • DSA
  • Practice Pattern Searching
  • Tutorial on Pattern Searching
  • Naive Pattern Searching
  • Rabin Karp
  • KMP Algorithm
  • Z Algorithm
  • Trie for Pattern Seaching
  • Manacher Algorithm
  • Suffix Tree
  • Ukkonen's Suffix Tree Construction
  • Boyer Moore
  • Aho-Corasick Algorithm
  • Wildcard Pattern Matching
Open In App
Next Article:
An Overview of Cloud Cryptography
Next article icon

Custom Building Cryptography Algorithms (Hybrid Cryptography)

Last Updated : 02 Mar, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

Cryptography can be defined as an art of encoding and decoding the patterns (in the form of messages).

Cryptography is a very straightforward concept which deals with manipulating the strings (or text) to make them unreadable for the intermediate person. It has a very effective way to encrypt or decrypts the text coming from the other parties. Some of the examples are, Caesar Cipher, Viginere Cipher, Columnar Cipher, DES, AES and the list continues. To develop custom cryptography algorithm, hybrid encryption algorithms can be used. 

Hybrid Encryption is a concept in cryptography which combines/merge one/two cryptography algorithms to generate more effective encrypted text.

Example:

FibBil Cryptography Algorithm

Problem Statement:

Program to generate an encrypted text, by computing Fibonacci Series, adding the terms of Fibonacci Series with each plaintext letter, until the length of the key.

Algorithm:

For Encryption: Take an input plain text and key from the user, reverse the plain text and concatenate the plain text with the key, Copy the string into an array. After copying, separate the array elements into two parts, EvenArray, and OddArray in which even index of an array will be placed in EvenArray and same for OddArray. Start generating the Fibonacci Series F(i) up-to-the length of the keyj such that c=i+j where c is cipher text with mod 26. Append all the cth elements in a CipherString and, so Encryption Done!. When sum up concept is use, it highlights of implementing Caesar Cipher. 

For Decryption: Vice Versa of the Encryption Algorithm

Example for the Algorithm: 
 

Input: hello 
Key: abcd 
Output: riobkxezg 
Reverse the input, olleh, append this with the key i.e. ollehabcd. 
EvenString: leac 
OddString: olhbd
As key length is 4, 4 times loop will be generated including FibNum 0, which is ignored.
For EvenArray Ciphers: 
FibNum: 1 
In Even Array for l and FibNum 1 cip is k 
In Even Array for e and FibNum 1 cip is d 
In Even Array for a and FibNum 1 cip is z 
In Even Array for c and FibNum 1 cip is b 
FibNum: 2 
In Even Array for l and FibNum 2 cip is j 
In Even Array for e and FibNum 2 cip is c 
In Even Array for a and FibNum 2 cip is y 
In Even Array for c and FibNum 2 cip is a 
FibNum: 3 (Final Computed letters) 
In Even Array for l and FibNum 3 cip is i 
In Even Array for e and FibNum 3 cip is b 
In Even Array for a and FibNum 3 cip is x 
In Even Array for c and FibNum 3 cip is z
For OddArray Ciphers 
FibNum: 1 
In Odd Array for o and FibNum 1 cip is p 
In Odd Array for l and FibNum 1 cip is m 
In Odd Array for h and FibNum 1 cip is i 
In Odd Array for b and FibNum 1 cip is c 
In Odd Array for d and FibNum 1 cip is e 
FibNum: 2 
In Odd Array for o and FibNum 2 cip is q 
In Odd Array for l and FibNum 2 cip is n 
In Odd Array for h and FibNum 2 cip is j 
In Odd Array for b and FibNum 2 cip is d 
In Odd Array for d and FibNum 2 cip is f 
FibNum: 3 (Final Computed letters) 
In Odd Array for o and FibNum 3 cip is r 
In Odd Array for l and FibNum 3 cip is o 
In Odd Array for h and FibNum 3 cip is k 
In Odd Array for b and FibNum 3 cip is e 
In Odd Array for d and FibNum 3 cip is g

Arrange EvenArrayCiphers and OddArrayCiphers in their index order, so final String Cipher will be, riobkxezg

Program:

C++14
#include<bits/stdc++.h>  using namespace std;   string encryptText(string password, string key)  {      int a = 0, b = 1, c = 0,         m = 0, k = 0, j = 0;      string cipher = "", temp = "";       // Declare a password string      string pw = password;       // Reverse the String      reverse(pw.begin(), pw.end());      pw = pw + key;       // For future Purpose      temp = pw;     string stringArray = temp;     string evenString = "", oddString = "";       // Declare EvenArray for storing      // even index of stringArray      string evenArray;       // Declare OddArray for storing      // odd index of stringArray      string oddArray;       // Storing the positions in their      // respective arrays      for(int i = 0;              i < stringArray.length(); i++)     {          if (i % 2 == 0)          {              oddString = oddString +                          stringArray[i];          }          else          {              evenString = evenString +                           stringArray[i];          }      }       evenArray = new char[evenString.length()];      oddArray = new char[oddString.length()];       // Generate a Fibonacci Series      // Upto the Key Length      while (m <= key.length())     {                  // As it always starts with 1          if (m == 0)              m = 1;           else         {                           // Logic For Fibonacci Series              a = b;              b = c;              c = a + b;                          for(int i = 0;                      i < evenString.length();                     i++)             {                                   // Caesar Cipher Algorithm Start                 // for even positions                  int p = evenString[i];                  int cip = 0;                                   if (p == '0' || p == '1' ||                     p == '2' || p == '3' ||                      p == '4' || p == '5' ||                     p == '6' || p == '7' ||                     p == '8' || p == '9')                 {                      cip = p - c;                                           if (cip < '0')                          cip = cip + 9;                  }                  else                 {                      cip = p - c;                      if (cip < 'a')                     {                          cip = cip + 26;                      }                  }                  evenArray[i] = (char)cip;                                   // Caesar Cipher Algorithm End             }              for(int i = 0;                      i < oddString.length();                     i++)             {                                   // Caesar Cipher Algorithm                  // Start for odd positions                  int p = oddString[i];                  int cip = 0;                                   if (p == '0' || p == '1' ||                      p == '2' || p == '3' ||                      p == '4' || p == '5' ||                     p == '6' || p == '7' ||                      p == '8' || p == '9')                 {                      cip = p + c;                      if (cip > '9')                          cip = cip - 9;                  }                  else                 {                      cip = p + c;                      if (cip > 'z')                     {                          cip = cip - 26;                      }                  }                  oddArray[i] = (char)cip;                                   // Caesar Cipher Algorithm End              }              m++;          }      }       // Storing content of even and      // odd array to the string array      for(int i = 0; i < stringArray.size(); i++)     {          if (i % 2 == 0)         {              stringArray[i] = oddArray[k];              k++;          }          else         {              stringArray[i] = evenArray[j];              j++;          }      }           // Generating a Cipher Text      // by stringArray (Caesar Cipher)      for(char d : stringArray)     {          cipher = cipher + d;      }           // Return the Cipher Text      return cipher;  }   // Driver code int main()  {      string pass = "hello";      string key = "abcd";           cout << encryptText(pass, key);       return 0; }   // This code is contributed by himanshu77 
Java
import java.util.*; import java.lang.*;  class GFG {      public static void main(String[] args)     {         String pass = "hello";         String key = "abcd";         System.out.println(encryptText(pass, key));     }     public static String encryptText(String password, String key)     {         int a = 0, b = 1, c = 0, m = 0, k = 0, j = 0;         String cipher = "", temp = "";          // Declare a password string         StringBuffer pw = new StringBuffer(password);          // Reverse the String         pw = pw.reverse();         pw = pw.append(key);          // For future Purpose         temp = pw.toString();         char stringArray[] = temp.toCharArray();         String evenString = "", oddString = "";          // Declare EvenArray for storing         // even index of stringArray         char evenArray[];          // Declare OddArray for storing         // odd index of stringArray         char oddArray[];          // Storing the positions in their respective arrays         for (int i = 0; i < stringArray.length; i++) {             if (i % 2 == 0) {                 oddString = oddString + Character.toString(stringArray[i]);             }             else {                 evenString = evenString + Character.toString(stringArray[i]);             }         }         evenArray = new char[evenString.length()];         oddArray = new char[oddString.length()];          // Generate a Fibonacci Series         // Upto the Key Length         while (m <= key.length()) {             // As it always starts with 1             if (m == 0)                 m = 1;              else {                  // Logic For Fibonacci Series                 a = b;                 b = c;                 c = a + b;                 for (int i = 0; i < evenString.length(); i++) {                     // Caesar Cipher Algorithm Start for even positions                     int p = evenString.charAt(i);                     int cip = 0;                     if (p == '0' || p == '1' || p == '2' || p == '3' || p == '4'                         || p == '5' || p == '6'                         || p == '7' || p == '8' || p == '9') {                         cip = p - c;                         if (cip < '0')                             cip = cip + 9;                     }                     else {                         cip = p - c;                         if (cip < 'a') {                             cip = cip + 26;                         }                     }                     evenArray[i] = (char)cip;                     /* Caesar Cipher Algorithm End*/                 }                 for (int i = 0; i < oddString.length(); i++) {                     // Caesar Cipher Algorithm Start for odd positions                     int p = oddString.charAt(i);                     int cip = 0;                     if (p == '0' || p == '1' || p == '2' || p == '3' || p == '4'                         || p == '5' || p == '6'                         || p == '7' || p == '8' || p == '9') {                         cip = p + c;                         if (cip > '9')                             cip = cip - 9;                     }                     else {                         cip = p + c;                         if (cip > 'z') {                             cip = cip - 26;                         }                     }                     oddArray[i] = (char)cip;                     // Caesar Cipher Algorithm End                 }                  m++;             }         }          // Storing content of even and         // odd array to the string array         for (int i = 0; i < stringArray.length; i++) {             if (i % 2 == 0) {                 stringArray[i] = oddArray[k];                 k++;             }             else {                 stringArray[i] = evenArray[j];                 j++;             }         }         // Generating a Cipher Text         // by stringArray (Caesar Cipher)         for (char d : stringArray) {             cipher = cipher + d;         }          // Return the Cipher Text         return cipher;     } } 
C#
// C# code to implement the approach using System; using System.Collections.Generic;  class GFG {    // Driver Code   public static void Main(string[] args)   {     string pass = "hello";     string key = "abcd";     Console.WriteLine(encryptText(pass, key));   }    public static string encryptText(string password,                                    string key)   {     int a = 0, b = 1, c = 0, m = 0, k = 0, j = 0;     string cipher = "", temp = "";      // Declare a password string     char[] pw = password.ToCharArray();      // Reverse the String     Array.Reverse(pw);      // For future Purpose     temp = new string(pw) + key;     char[] stringArray = temp.ToCharArray();     string evenString = "", oddString = "";      // Declare EvenArray for storing     // even index of stringArray     char[] evenArray;      // Declare OddArray for storing     // odd index of stringArray     char[] oddArray;      // Storing the positions in their respective arrays     for (int i = 0; i < stringArray.Length; i++) {       if (i % 2 == 0) {         oddString = oddString           + Char.ToString(stringArray[i]);       }       else {         evenString           = evenString           + Char.ToString(stringArray[i]);       }     }     evenArray = new char[evenString.Length];     oddArray = new char[oddString.Length];      // Generate a Fibonacci Series     // Upto the Key Length     while (m <= key.Length) {       // As it always starts with 1       if (m == 0)         m = 1;        else {          // Logic For Fibonacci Series         a = b;         b = c;         c = a + b;         for (int i = 0; i < evenString.Length;              i++) {           // Caesar Cipher Algorithm Start for           // even positions           int p = evenString[i];           int cip = 0;           if (p == '0' || p == '1' || p == '2'               || p == '3' || p == '4' || p == '5'               || p == '6' || p == '7' || p == '8'               || p == '9') {             cip = p - c;             if (cip < '0')               cip = cip + 9;           }           else {             cip = p - c;             if (cip < 'a') {               cip = cip + 26;             }           }           evenArray[i] = (char)cip;           /* Caesar Cipher Algorithm End*/         }         for (int i = 0; i < oddString.Length; i++) {           // Caesar Cipher Algorithm Start for odd           // positions           int p = oddString[i];           int cip = 0;           if (p == '0' || p == '1' || p == '2'               || p == '3' || p == '4' || p == '5'               || p == '6' || p == '7' || p == '8'               || p == '9') {             cip = p + c;             if (cip > '9')               cip = cip - 9;           }           else {             cip = p + c;             if (cip > 'z') {               cip = cip - 26;             }           }           oddArray[i] = (char)cip;           // Caesar Cipher Algorithm End         }          m++;       }     }      // Storing content of even and     // odd array to the string array     for (int i = 0; i < stringArray.Length; i++) {       if (i % 2 == 0) {         stringArray[i] = oddArray[k];         k++;       }       else {         stringArray[i] = evenArray[j];         j++;       }     }     // Generating a Cipher Text     // by stringArray (Caesar Cipher)     foreach(char d in stringArray)     {       cipher = cipher + d;     }      // Return the Cipher Text     return cipher;   } }  // This code is contributed by phasing17 
Python3
# Python3 program to implement the approach   def encryptText(password, key):     a = 0     b = 1     c = 0     m = 0     k = 0     j = 0     cipher = ""     temp = ""      # Declare a password string     pw = password      # Reverse the String     pw = pw[::-1]     pw = pw + key      # For future Purpose     temp = pw     stringArray = list(temp)     evenString = ""     oddString = ""      # Declare EvenArray for storing     # even index of stringArray     evenArray = ""      # Declare OddArray for storing     # odd index of stringArray     oddArray = ""      # Storing the positions in their     # respective arrays     for i in range(len(stringArray)):          if (i % 2 == 0):              oddString = oddString + stringArray[i]          else:             evenString = evenString + stringArray[i]      evenArray = ["" for _ in range(len(evenString))]     oddArray = ["" for _ in range(len(oddString))]      # Generate a Fibonacci Series     # Upto the Key Length     while (m <= len(key)):          # As it always starts with 1         if (m == 0):             m = 1          else:              # Logic For Fibonacci Series             a = b             b = c             c = a + b              for i in range(len(evenString)):                  # Caesar Cipher Algorithm Start                 # for even positions                 p = evenString[i]                 cip = 0                  if p in "1234567890":                     cip = ord(p) - c                      if (cip < ord('0')):                         cip = cip + 9                  else:                     cip = ord(p) - c                     if (cip < ord('a')):                         cip = cip + 26                  evenArray[i] = chr(cip)                  # Caesar Cipher Algorithm End              for i in range(len(oddString)):                  # Caesar Cipher Algorithm                 # Start for odd positions                 p = oddString[i]                 cip = 0                  if p in "0123456789":                     cip = ord(p) + c                     if (cip > ord('9')):                         cip = cip - 9                  else:                      cip = ord(p) + c                     if (cip > ord('z')):                          cip = cip - 26                  oddArray[i] = chr(cip)                  # Caesar Cipher Algorithm End             m += 1      # Storing content of even and     # odd array to the string array     for i in range(len(stringArray)):          if (i % 2 == 0):              stringArray[i] = oddArray[k]             k += 1          else:              stringArray[i] = evenArray[j]             j += 1      # Generating a Cipher Text     # by stringArray (Caesar Cipher)     for d in stringArray:         cipher = cipher + d      # Return the Cipher Text     return cipher   # Driver code pw = "hello" key = "abcd"  print(encryptText(pw, key))   # This code is contributed by phasing17 
JavaScript
// Javascript code implementation   function encryptText(password, key) {     let a = 0, b = 1, c = 0, m = 0, k = 0, j = 0;     let cipher = "";     let temp = "";      // Declare a password string     let pass = password;     let pw = Array.from(pass);          // Reverse the String     pw.reverse();     for(let i = 0; i < Array.from(key).length; i++){         pw.push(Array.from(key)[i]);     }      // For future Purpose     temp = pw.join("");     let stringArray = temp.split('');     let evenString = "";     let oddString = "";            // Storing the positions in their respective arrays     for (let i = 0; i < stringArray.length; i++) {         if (i % 2 == 0) {             oddString = oddString + stringArray[i];         }         else {             evenString = evenString + stringArray[i];         }     }          // Declare EvenArray for storing     // even index of stringArray     let evenArray = new Array(evenString.length);      // Declare OddArray for storing     // odd index of stringArray     let oddArray = new Array(oddString.length);      // Generate a Fibonacci Series     // Upto the Key Length     while (m <= key.length) {         // As it always starts with 1         if (m == 0)             m = 1;          else {              // Logic For Fibonacci Series             a = b;             b = c;             c = a + b;             for (let i = 0; i < evenString.length; i++) {                 // Caesar Cipher Algorithm Start for even positions                 let p = evenString[i];                 let cip = 0;                 if (p == '0' || p == '1' || p == '2' || p == '3' || p == '4'                     || p == '5' || p == '6'                     || p == '7' || p == '8' || p == '9') {                     cip = p.charCodeAt(0) - c;                     if (cip < '0'.charCodeAt(0))                         cip = cip + 9;                 }                 else {                     cip = p.charCodeAt(0) - c;                     if (cip < 'a'.charCodeAt(0)) {                         cip = cip + 26;                     }                 }                 evenArray[i] = String.fromCharCode(cip);                 /* Caesar Cipher Algorithm End*/             }             for (let i = 0; i < oddString.length; i++) {                 // Caesar Cipher Algorithm Start for odd positions                 let p = oddString[i];                 let cip = 0;                 if (p == '0' || p == '1' || p == '2' || p == '3' || p == '4'                     || p == '5' || p == '6'                     || p == '7' || p == '8' || p == '9') {                     cip = p + c;                     if (cip > '9'.charCodeAt(0))                         cip = cip - 9;                 }                 else {                     cip = p.charCodeAt(0)+ c;                     if (cip > 'z'.charCodeAt(0)) {                         cip = cip - 26;                     }                 }                 // console.log(cip);                 oddArray[i] = String.fromCharCode(cip);                 // Caesar Cipher Algorithm End             }              m++;         }     }      // Storing content of even and     // odd array to the string array     for (let i = 0; i < stringArray.length; i++) {         if (i % 2 == 0) {             stringArray[i] = oddArray[k];             k++;         }         else {             stringArray[i] = evenArray[j];             j++;         }     }     // Generating a Cipher Text     // by stringArray (Caesar Cipher)     for(let i = 0; i < stringArray.length; i++){         cipher = cipher + stringArray[i];     }     // Return the Cipher Text     return cipher; }   let pass = "hello"; let key = "abcd"; console.log(encryptText(pass, key));  // The code is contributed by Nidhi goel.  

Output: 
riobkxezg

 

Conclusion:

Hybrid Algorithms for the cryptography are effective and so, it is not very easy to detect the pattern and decode the message. Here, the algorithm is a combination of mathematical function and Caesar Cipher, so as to implement Hybrid Cryptography Algorithm.
 


Next Article
An Overview of Cloud Cryptography

B

bilal-hungund
Improve
Article Tags :
  • Java
  • Pattern Searching
  • Mathematical
  • Java Programs
  • DSA
  • cryptography
  • Java 8
Practice Tags :
  • Java
  • Mathematical
  • Pattern Searching

Similar Reads

    Cryptography Tutorial
    Cryptography is a technique of securing communication by converting plain text into unintelligible ciphertext. It involves various algorithms and protocols to ensure data confidentiality, integrity, authentication, and non-repudiation. The two primary types of cryptography are symmetric key cryptogr
    7 min read

    Cryptography Basic

    Cryptography Introduction
    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 prevents malicious third parties from retrieving information being shared between two entities thereby following th
    4 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 i
    4 min read
    Cryptography and its Types
    Cryptography is a technique of securing information and communications using codes to ensure confidentiality, integrity and authentication. Thus, preventing unauthorized access to information. The prefix "crypt" means "hidden" and the suffix "graphy" means "writing". In Cryptography, the techniques
    8 min read
    Cryptography and Network Security Principles
    In the present-day scenario security of the system is the sole priority of any organization. The main aim of any organization is to protect their data from attackers. In cryptography, attacks are of two types: Passive attacks and Active attacks. Passive attacks are those that retrieve information fr
    9 min read

    Cryptography Algorithm

    Public Key Encryption
    Public key cryptography provides a secure way to exchange information and authenticate users by using pairs of keys. The public key is used for encryption and signature verification, while the private key is used for decryption and signing. When the two parties communicate with each other to transfe
    7 min read
    Traditional Symmetric Ciphers
    The two types of traditional symmetric ciphers are Substitution Cipher and Transposition Cipher. The following flowchart categories the traditional ciphers: 1. Substitution Cipher: Substitution Ciphers are further divided into Mono-alphabetic Cipher and Poly-alphabetic Cipher. First, let's study abo
    3 min read
    What is an Asymmetric Encryption?
    Asymmetric encryption, also known as public-key cryptography, is a type of encryption that uses a pair of keys to encrypt and decrypt data. The pair of keys includes a public key, which can be shared with anyone, and a private key, which is kept secret by the owner. What is an Asymmetric Encryption?
    8 min read
    Difference between Private key and Public key
    Cryptography as a field emphasizes the need to guarantee secure communication and data privacy. There are mainly two approaches available to perform this operation: – Private Key Cryptography (RIC or Symmetric Key Cryptography) and Public Key Cryptography (PKE or Asymmetric Key Cryptography). Althou
    6 min read

    What is data encryption?

    What is Data Encryption?
    Data encryption is the process of converting readable information (plaintext) into an unreadable format (ciphertext) to protect it from unauthorized access. It is a method of preserving data confidentiality by transforming it into ciphertext, which can only be decoded using a unique decryption key p
    10 min read
    Encryption, Its Algorithms And Its Future
    Encryption plays a vital role in today’s digital world, serving a major role in modern cyber security. It involves converting plain text into cipher text, ensuring that sensitive information remains secure from unauthorized access. By making data unreadable to unauthorized parties, encryption helps
    10 min read
    SHA-1 Hash
    SHA-1 or Secure Hash Algorithm 1 is a cryptographic algorithm that takes an input and produces a 160-bit (20-byte) hash value. This hash value is known as a message digest. This message digest is usually then rendered as a hexadecimal number which is 40 digits long. It is a U.S. Federal Information
    7 min read
    RC4 Encryption Algorithm
    RC4 is a stream cipher and variable-length key algorithm. This algorithm encrypts one byte at a time (or larger units at a time). A key input is a pseudorandom bit generator that produces a stream 8-bit number that is unpredictable without knowledge of the input key, The output of the generator is c
    6 min read
    Hash Functions in System Security
    Hash Function is a function that has a huge role in making a System Secure as it converts normal data given to it as an irregular value of fixed length. We can imagine it to be a Shaker in our homes. When we put data into this function it outputs an irregular value. The Irregular value it outputs is
    4 min read
    Blowfish Algorithm with Examples
    Blowfish is an encryption technique designed by Bruce Schneier in 1993 as an alternative to the DES Encryption Technique. It is significantly faster than DES and provides a good encryption rate with no effective cryptanalysis technique found to date. It is one of the first secure block ciphers not s
    14 min read
    Difference between MD5 and SHA1
    MD5 stands for Message Digest and SHA1 stands for Secure Hash Algorithm both are cryptographic hash algorithms used for security purposes. SHA-1 or Secure Hash Algorithm 1 is a cryptographic algorithm that takes an input and produces a 160-bit (20-byte) hash value. This hash value is known as a mess
    5 min read
    Difference between RSA algorithm and DSA
    In cryptography, the two commonly used algorithms in modern cryptography for secure data transmission and to ensure the signatures of digital signatures, are the Rivest-Shamir-Adleman (RSA) algorithm and Digital Signature Algorithm (DSA). We'll learn about RSA and DSA, how they work when are they us
    8 min read

    Classical Encryption Techniques

    Symmetric Cipher Model
    Symmetric Encryption is the most basic and old method of encryption. It uses only one key for the process of both the encryption and decryption of data. Thus, it is also known as Single-Key Encryption. A few basic terms in Cryptography are as follows: Plain Text: original message to be communicated
    3 min read
    Substitution Cipher
    Hiding some data is known as encryption. When plain text is encrypted it becomes unreadable and is known as ciphertext. In a Substitution cipher, any character of plain text from the given fixed set of characters is substituted by some other character from the same set depending on a key. For exampl
    6 min read
    Columnar Transposition Cipher
    Given a plain-text message and a numeric key, cipher/de-cipher the given text using Columnar Transposition Cipher The Columnar Transposition Cipher is a form of transposition cipher just like Rail Fence Cipher. Columnar Transposition involves writing the plaintext out in rows, and then reading the c
    12 min read

    Block Cipher , DES and AES

    Block Cipher Design Principles
    Block ciphers are built in the Feistel cipher structure. Block cipher has a specific number of rounds and keys for generating ciphertext.Block cipher is a type of encryption algorithm that processes fixed-size blocks of data, usually 64 or 128 bits, to produce ciphertext. The design of a block ciphe
    3 min read
    Block Cipher modes of Operation
    Encryption algorithms are divided into two categories based on the input type: block cipher and stream cipher. A block cipher is an encryption algorithm that takes a fixed-size input (e.g., b bits) and produces a ciphertext of b bits. If the input is larger than b bits, it can be divided further. Th
    8 min read
    Data Encryption Standard (DES) | Set 1
    Data Encryption Standard (DES) is a symmetric block cipher. By 'symmetric', we mean that the size of input text and output text (ciphertext) is same (64-bits). The 'block' here means that it takes group of bits together as input instead of encrypting the text bit by bit. Data encryption standard (DE
    15+ min read
    Double DES and Triple DES
    As we know the Data encryption standard (DES) uses 56 bit key to encrypt any plain text which can be easily be cracked by using modern technologies. To prevent this from happening double DES and triple DES were introduced which are much more secured than the original DES because it uses 112 and 168
    2 min read
    Strength of Data encryption standard (DES)
    Data Encryption Standard (DES) is a symmetric block cipher. By ‘symmetric’, we mean that the size of input text and output text (ciphertext) is same (64-bits). The block here means that it takes group of bits together as input instead of encrypting the text bit by bit. Data encryption standard (DES)
    5 min read
    AES Full Form
    AES stands for Advanced Encryption Standard and is a majorly used symmetric encryption algorithm. It is mainly used for encryption and protection of electronic data. It was used as the replacement of DES(Data encryption standard) as it is much faster and better than DES. AES consists of three block
    2 min read
    Advanced Encryption Standard (AES)
    Advanced Encryption Standard (AES) is a highly trusted encryption algorithm used to secure data by converting it into an unreadable format without the proper key. It is developed by the National Institute of Standards and Technology (NIST) in 2001. It is is widely used today as it is much stronger t
    7 min read
    Difference Between AES and DES Ciphers
    DES (Data Encryption Standard) and AES (Advanced Encryption Standard) are both symmetric key encryption algorithms used to secure data. They use the same key for both encryption and decryption, but differ significantly in strength and design. Advanced Encryption Standard (AES) is a highly trusted en
    5 min read

    Public Key Cryptography and RSA

    RSA Algorithm in Cryptography
    RSA(Rivest-Shamir-Adleman) Algorithm is an asymmetric or public-key cryptography algorithm which means it works on two different keys: Public Key and Private Key. The Public Key is used for encryption and is known to everyone, while the Private Key is used for decryption and must be kept secret by t
    13 min read
    Implementation of Diffie-Hellman Algorithm
    Diffie-Hellman algorithm:The Diffie-Hellman algorithm is being used to establish a shared secret that can be used for secret communications while exchanging data over a public network using the elliptic curve to generate points and get the secret key using the parameters. For the sake of simplicity
    10 min read
    ElGamal Encryption Algorithm
    ElGamal Encryption is a public-key cryptosystem. It uses asymmetric key encryption to communicate between two parties and encrypt the message. This cryptosystem is based on the difficulty of finding discrete logarithms in a cyclic group that is even if we know ga and gk, it is extremely difficult to
    6 min read

    What is Cryptanalysis?

    Understanding Rainbow Table Attack
    What is a Rainbow Table? The passwords in a computer system are not stored directly as plain texts but are hashed using encryption. A hash function is a 1-way function, which means that it can't be decrypted. Whenever a user enters a password, it is converted into a hash value and is compared with t
    4 min read
    What is a Dictionary Attack?
    A Dictionary Attack is an attack vector used by the attacker to break in a system, which is password protected, by putting technically every word in a dictionary as a form of password for that system. This attack vector is a form of Brute Force Attack. The dictionary can contain words from an Englis
    2 min read
    Brute Force Attack
    A Brute force attack is a well known breaking technique, by certain records, brute force attacks represented five percent of affirmed security ruptures. A brute force attack includes 'speculating' username and passwords to increase unapproved access to a framework. Brute force is a straightforward a
    3 min read

    Comman Cryptography

    Custom Building Cryptography Algorithms (Hybrid Cryptography)
    Cryptography can be defined as an art of encoding and decoding the patterns (in the form of messages). Cryptography is a very straightforward concept which deals with manipulating the strings (or text) to make them unreadable for the intermediate person. It has a very effective way to encrypt or dec
    15+ 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 en
    4 min read
    Quantum Cryptography
    The uncertainty principle of quantum physics builds the earliest foundations for quantum cryptography. With quantum computers of the future being expected to solve discrete logarithmic problems and the popularly known cryptography methods such as AES, RSA, DES, quantum cryptography becomes the fores
    7 min read
    Image Steganography in Cryptography
    The word Steganography is derived from two Greek words- 'stegos' meaning 'to cover' and 'grayfia', meaning 'writing', thus translating to 'covered writing', or 'hidden writing'. Steganography is a method of hiding secret data, by embedding it into an audio, video, image, or text file. It is one of t
    8 min read
    DNA Cryptography
    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 mol
    12 min read
    Caesar Cipher in Cryptography
    The Caesar Cipher is one of the simplest and oldest methods of encrypting messages, named after Julius Caesar, who reportedly used it to protect his military communications. This technique involves shifting the letters of the alphabet by a fixed number of places. For example, with a shift of three,
    11 min read
    One Time Password (OTP) algorithm in Cryptography
    Authentication, the process of identifying and validating an individual is the rudimentary step before granting access to any protected service (such as a personal account). Authentication has been built into the cyber security standards and offers to prevent unauthorized access to safeguarded resou
    7 min read

    Data Integrity in Cryptography

    Message Authentication Codes
    Message Authentication Codes are the codes which plays their role in two important functions: Authentication Detection and Falsification Detection. Where do we need these codes? Suppose User A send message to user B with message - 'abc'. A encrypts the message using Shared - Key Cryptosystem for enc
    2 min read
    Digital Signatures and Certificates
    Digital signatures and certificates are two key technologies that play an important role in ensuring the security and authenticity of online activities. They are essential for activities such as online banking, secure email communication, software distribution, and electronic document signing. By pr
    11 min read
    Public Key Infrastructure
    Public key infrastructure or PKI is the governing body behind issuing digital certificates. It helps to protect confidential data and gives unique identities to users and systems. Thus, it ensures security in communications. The public key infrastructure uses a pair of keys: the public key and the p
    7 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences