#include #include #include #include void encrypt(void); void decrypt(void); void main() { clrscr(); char chk; do { printf("\n \n MAIN MENU:"); printf("\n"); printf("\t \t \t \n PROGRAM TO DEMONSTRATE AUTOKEY CIPHER:"); printf("\n"); printf("\n Press 'e' to encrypt 'd' to decrypt 'x' to exit:"); scanf("%c",&chk); printf("\n"); switch(chk) { case 'd': decrypt(); break; case 'e': encrypt(); break; case 'x': break; default: break; } clrscr(); } while(chk!='x'); } void encrypt() { char* pln; int i,t,k,l,sh; printf("\n Enter the key generator:"); scanf("%d",&k); printf("\n Enter the string lenth:"); scanf("%d",&l); pln=new char[l+1]; printf("\n Enter the plain text:"); cin.getline(pln,'\l'); printf("\n The corresponding cipher text is:"); for(i=0;i=1) { t=int(pln[i-1])-97; sh=(t+(int(pln[i])-97))%26; printf("%c",char(sh+65)); //cout<=1) { t=((int(cip[i])-65)-p)%26; if(t<0) { int l=(t+(26))%26; t=l; } p=t; cout<