Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  a.cpp
Language: C/C++
Code:
# include<stdio.h>
int main()
{
char array[100],cipher[100];
int c=0,x=0,y=0,p=0,q=0,i=0,j=0;
int key1,key2;
printf("this is a program of symmetric key encryption on n");
printf("enter the sentences");
scanf("%s",array);
printf("enter the first keyn");
scanf("%d",&key1);
while(c=array[i]!='\0')
{
array[x++]=(char)c;
cipher[y++]=(char)c(c+key+1);
j++;
}
array[x]=0;
cipher[y]=0;
printf("encrypting text is %sn",cipher);
printf("enter the second keyn");
printf("%d",&key2);
if(key1==key2)
{
while(c=cipher[j]!='�')
{
cipher[p++]=(char)c;
array[q++]=(char)(c-key2);
j++;
}
cipher[p]=0;
cipher[q]=0;
printf("decrypted text is %sn",array);
}
else
{
if(key1!=key3)
printf("keys are different please enter same key");
}
return o;
}
          
          
Comments: