Professional Documents
Culture Documents
int main()
int key,i,length;
int result;
cin>> plain;
cout<<"enter the key value"<<endl;
cin>>key;
cout<<plain<<endl;
cipher[i]=plain[i] + key;
cout<<cipher[i];
for(i=0;i<length;i++)
{
plain[i]=cipher[i]-key;
if(isupper(cipher[i])&&(plain[i]<'A'))
plain[i]=plain[i]+26;
if(islower(cipher[i])&&(plain[i]<'a'))
plain[i]=plain[i]+26;
cout<<plain[i];
}
}
}
OUTPUT:
LEARNING OUTCOMES:
A Caesar cipher is very easy to design, but also very easy to decode. To crack a Caesar code, a
decoder could simply go through every possible shift of the alphabet (all 2626 of them) and see if
any sensible message appears