Monday, May 2, 2011

PROGRAM TO ENCRYPT GIVEN MESSAGE BY USING ROT 13

This Program will encrypt given word or sentence into ROT 13

Click on download button below to get the zip file

DOWNLOAD

Coding

#include<conio.h>
#include<stdio.h>
#include<string.h>
main()
{
do
{
clrscr();
char ch[160];
int length;
printf("\t\tTHIS PROGRAM IS CODED BY SYED MUHAMMED TAQI\n\nVISIT MY blog techgulf.blogspot.com\n\nNOTE:\n1.Please type you word or sentence and press enter to encrypt you input\n\n2.Input is case sensitive");
printf("\n\nEnter your message : ");
gets(ch);
length=strlen(ch);
for(int a=0; a<length; a++)
{
if(ch[a]>=65 && ch[a]<=77)
    ch[a]=ch[a]+13;

else if (ch[a]>=78 && ch[a]<=90)
    ch[a]=ch[a]-13;

else if (ch[a]>=97 && ch[a]<=109)
    ch[a]=ch[a]+13;

else if (ch[a]>=110   && ch[a]<=122)
    ch[a]=ch[a]-13;
}
printf("\nYou meesage after encryption is\n\n");
for(a=0; a<length; a++)
printf("%c",ch[a]);
printf("\n\nDo you want to run this program again (y/n) ?");
}
while(getche()!='n');
printf("\n\nThank You for using the program");
getche();
}




Hope you like it :)

No comments:

Post a Comment