<center><b>Visioneer Cipher</center></b>
<center></center>
After a long time, I sat next to this series. Today we will talk about Visioner's cipher. But before that come let me hear a story. Bob wants to send a love letter to Alice. But he does not want anyone else to read this love letter! So he decided to write his letter in such a way that only Bobby could decrypt the letter. So very good, he wrote a letter using Caesar cipher and wrote it. But sometimes the eve is the eve She is reading self-education with cryptography. So after receiving a letter from the postman, he realized that it was Caesar cipher. She wrote a code now. In that code he printed the letters in 26 ways and saw what came of it.
Diameter, her work is over! He got the original letter.
This Eve is an eavesdropper. Evasdrapper means that anyone who listens to others' ears or tries to listen to them. He did not even get too much trouble reading this secret letter. There is only 26 ways to try. It is called in the language of computer science, the Braun Force, we will say Kamala Khata. Caesar cipher is easy to decrypt in Kamala Khat, because there are possible ways only 26
<center></center>
So this evasadrapar's life is a bit difficult (and Alice Bobs love the thorny way) Blaise de Vigenère came with Vigenère Cipher It's a slightly modified form of Caesar cipher. But like the Caesar cipher, it does not shift the same amount of color to every letter. This cipher has another text as key. By using this key, every color of the plain text is shifted. Feeling difficult? An example can be understood!
<center><h1>Suppose, our key is KISUPARINA</center><h1>
Our key length is 10, then using this key, we can encrypt a maximum of 10-length playline. Or we can use this key in ten lengths like KISUPARINAKISUPARINA ... so let's see how I will encrypt using this key. We first write down what is the [0 based index] in each alphabetical alphabet of this key.
-------
<center>K I S U P A R I N A
10 8 13 20 15 0 17 8 13 0</center>
------
Then we will shift the first character to 10 cells, the second character will shift to 8 rooms. This will continue. If the length of the plain text exceeds 10, we will use the modulus, such as 21 cells to shift 10 cells (because 21% length = 1). Here is the key length of 10. Likewise, I will shift 99-th characters to 13 (99% length = 9) cells. And after crossing 26, we can divide 26 by sharing just like Caesar Cipher and get a new character with the result.
<b>Plaintext:</b> SHOSHIKKHA
<b>Key:</b> KISUPARINA
<b>Ciphertext:</b> CPGMWIBSUA
Say a secret! I did not write this ciphertext by myself, code it out, I got the computer out. 😛The code is
#include <bits/stdc++.h>
using namespace std;
char txt[10000] = "SHOSHIKKHA";
char pat[10000] = "KISUPARINA";
int main () {
for (int i=0; i<strlen(txt); i++) txt[i] = ((txt[i]-'A' + pat[i] - 'A')%26 + 'A');
printf("%s\n", txt);
return 0;
}
Now say why we have used 0 based index? Because you have 'Z' in place of your key. Now if you shift 'A' to 26 house, what will you get? It will turn out to be 'A' again! So we will shift 25 for 'Z'!
Mathematically we can write this cipher as follows
Enakripasanah to E (M is i ) = (M is i + to K i )%: 26 to, the M is i is the i-th letter in plain text. And K i is the key color of the key.
<B>Decryption:</B>D(Mi) = ( Mi – Ki )%26
But it is still not possible to get out of Kamala khet, it is not. But it is much more difficult than the Caesar Cipher. Even if a word of plain text can guess exactly, decryption makes it much easier. But I will not talk about them today. Today so far Everyone will be good, be healthy, keep people and people around the country better.🙂