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, Columner 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.
FibBil Cryptography Algorithm
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.
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:
Reverse the input, olleh, append this with the key i.e. ollehabcd.
As key length is 4, 4 times loop will be generated including FibNum 0, which is ignored.
For EvenArray Ciphers:
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
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
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
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
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.
- DNA Cryptography
- The CIA triad in Cryptography
- RSA Algorithm in Cryptography
- Quantum Cryptography
- Cryptography and its Types
- Development of Cryptography
- Easy Key Management in Cryptography
- Caesar Cipher in Cryptography
- Image Steganography in Cryptography
- Birthday attack in Cryptography
- Computer Network | Cryptography Introduction
- One Time Password (OTP) algorithm in Cryptography
- Custom ArrayList in Java
- User-defined Custom Exception in Java
- Java Swing | Creating Custom Message Dialogs
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.