Aim: Implement Mono Alphabetic Cipher Encryption.
There are a number of different types of substitution cipher. If the cipher operates on single letters, it is termed a simple substitution cipher; a cipher that operates on larger groups of letters is termed polygraphic.
A monoalphabetic cipher uses fixed substitution over the entire message, whereas a polyalphabetic cipher uses a number of substitutions at different positions in the message, where a unit from the plaintext is mapped to one of several possibilities in the ciphertext and vice versa.
C Program Code:
#include<stdio.h>
#include<conio.h>
void main()
{
char pt[30] ,c[27], ct[30];
int i, j, index;
clrscr();
printf("\n\nImplement Mono Alphabetic Cipher Encryption-Decryption.");
printf("\nEnter Plain Text : ");
gets(pt);
printf("\nEnter Key From a to z : \n");
for(i = 0; i < 26; i++)
{
printf("%c-", i + 97);
c[i] = getch();
printf("%c , ", c[i]);
}
for(i = 0; i < strlen(pt); i++)
{
index = pt[i] - 97;
ct[i] = c[index];
}
printf("\n\nCipher Text is : ");
for(i = 0; i < strlen(pt); i++)
{
printf("%c", ct[i]);
}
getch();
}
Also Read - C program to count total words in text

6 Comments
WHERE IS DECRYPTION PROGRAM?
ReplyDeleteyesss...where is it??
Deleteyes bro where is it????
DeleteDecryption program will be added soon.
Deletedo youself.
ReplyDeleteThe Heuer link Caliber 02 is the real standout of the Monza. It's a COSC-certified flyback chronograph, something we've only seen in the vintage-inspired Autavia released link last year. A couple of years back, we explained why it can be one of the best-value Swiss-made chronographs on the market. It already features the column wheel and vertical clutch; the flyback functionality and COSC certification that TAG Heuer first link brought to the Autavia and now the Monza are souped-up bonuses.
ReplyDelete