My simple encrypt and decrypt code
include
include
include
using namespace std;
void encrypt( char [ ] );
void decrypt( char * b );
int main( )
{
char input[10];
int choice;
cout< <"Enter a string: "; cin>>input;
cout < < “Original string is: ” << input << endl;
do
{
cout<<”nn Press 1 to Encrpyt and 2 to decrypt: “;
cin>>choice;
if(choice 1)
{
encrypt( input );
cout < < “Encrypted string is: ” << input << endl;</p>
}
else if (choice 2)
{
decrypt( input );
cout << "Decrypted string is: " << input << endl;
}
else {break;}
}while (choice!=0);
getch();
}
void encrypt (char a[] )
{
for( int c=0; a© != ‘