0% found this document useful (0 votes)
31 views2 pages

Practical: - 2 Aim: Code:: Write A Program To Calculate Implement Monoalphabetic Cipher Encryption

Uploaded by

ronakidea
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

Practical: - 2 Aim: Code:: Write A Program To Calculate Implement Monoalphabetic Cipher Encryption

Uploaded by

ronakidea
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Practical: -2

Aim: Write a program to calculate Implement Monoalphabetic cipher encryption-


decryption.

Code:
#include<stdio.h>

#include<conio.h>

int main()

char
plaintext[75]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z
','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

char
ciphertext[75]={'M','N','B','V','C','X','Z','L','K','J','H','G','F','D','S','A','P','O','I','U','Y','T','R','E','W','
Q','m','n','b','v','c','x','z','l','k','j','h','g','f','d','s','a','p','o','i','u','y','t','r','e','w','q'};

int i,j;

char r[80],s[80];

printf("enter the plain text:");

gets(r);

for(i=0;i<r[i];i++)

for(j=0;j<52;j++)

if(plaintext[j]==r[i])

s[i]=ciphertext[j];

180303108018[Maitri Desai] Page 1


}

printf("cipher text is: %s",s);

for(i=0;i<s[i];i++)

for(j=0;j<52;j++)

if(ciphertext[j]==s[i])

r[i]=plaintext[j];

} }

printf(" \n plain text is: %s",r);

return 0;

Output:

180303108018[Maitri Desai] Page 2

You might also like