- Code: Select all
//----Simple Encryption / Decryption using XOR
// Written by Talbas March 8 2006
#include <iostream>
int main()
// Encryption Routine - replace the key and string with own data
{
char string[11]="talbas20011";
char key[11]="ABCDEFGHIJK";
for (int x=0; x<11; x++)
{
string[x]=string[x]^key[x];
std::cout << string[x];
}
// Decryption Routine - I placed this here to verify encryption
std:: cout << "\n";
for (int x=0; x<11; x++)
{
string[x]=key[x]^string[x];
std::cout << string[x];
}
return 0;
}




