Program - 2
Program - 2
Program - 2
Introduction: Monoalphabetic cipher is one where each symbol in plain text is
mapped to a fixed symbol in cipher text. The relationship between a character in the
plain text and the characters in the cipher text is one-to-one. Each alphabetic
character of plain text is mapped onto a unique alphabetic character of a cipher text.
It is a simple substitution cipher.Monoalphabetic Cipher is (cryptography) of a
substitution cipher, using the same fixed mappings from plain text to cipher letters
across the entire text.
Code:
Encryption:-
#include<bits/stdc++.h>
using namespace std;
int main()
{
string key;
key = "Computer";
cout << "Keyword : " <<key << endl;
string encoded = encoder(key);
return 0;
}
Decryption:-
#include<bits/stdc++.h>
using namespace std;
string decipher="";
int main()
{
string key;
key = "Computer";
cout << "Keyword : "<< key << endl;
return 0;
}
Output:
Encryption:-
Decryption:-
Finding and Learning : A keyword is used as the key, and it determines the letter
matchings of the cipher alphabet to the plain alphabet. Repeats of letters in the word
are removed, then the cipher alphabet is generated with the keyword matching to A,
B, C etc. until the keyword is used up, whereupon the rest of the ciphertext letters are
used in alphabetical order, excluding those already used in the key.