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© != ‘’; ++c ) ++a©;
strrev(a);
}

void decrypt( char * b ) {
strrev(b);
for( ; * b != ‘’; ++ b )—(* b);
}

December 16, 2008 + Posted in Blog blog blog.. +


1 Comment »

The URI to TrackBack this entry is: http://emptyminds.blogsome.com/2008/12/16/my-simple-encrypt-and-decrypt-code-3/trackback/

  1. Hi blog hopping, happy new year!

    Comment by AlRitch — December 31, 2008 @ 6:38 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.