#include <iostream>
#include <string> 

using namespace std;

void charout(wstring const& str)
{
  for (unsigned i = 0 ; i < str.length(); ++i)
    cout << static_cast<int>(str[i]) << ' ';
  cout << '\n';
}

int main()
{
  wstring toEncrypt = L"Test\u04EE";
  wchar_t keyToEncrypt = 'd';
  
  cout << "Before: ";
  charout(toEncrypt);

  for (int temp = 0; temp < toEncrypt.size(); temp++)
    toEncrypt[temp] ^= keyToEncrypt;
  cout << "The encrypted data = ";
  charout(toEncrypt);
  
  for (int temp = 0; temp < toEncrypt.size(); temp++)
    toEncrypt[temp] ^= keyToEncrypt;
  cout << "The unencrypted data = ";	
  charout(toEncrypt);
}
