just wrote a small program to see if I could fully understand the encryption scheme using XOR. I basically have it all, except for a small bug. First I'll give you the code snippet for my encrypting function:
Code:
void DCText::cipher()
{
  int i;   // Array subscript
  
  int strlngth = strlen(plntxt);
  cout << "String length of plaintext is " << strlngth << endl;

  for( i = 0; i < strlngth; i++)          // Encrypting 
     cprtxt[i] = plntxt[i] ^ key[i];

  int cprlength = strlen(cprtxt);
  cout << "String length of cprtxt is " << cprlength << endl;
}
cprtxt[], plntxt[], and key[] are members of the class DCText. Now that is clear, let me explain the problem. As you see, I first print the string length of the plaintext (ie, the non-encrypted text). The stringlength is correct here. Then, I do the actually encryption with the XOR ^ operator and store the encrypted character into the cprtxt[] array. I then print out the stringlength of the ciphertext (ie, the encrypted text). The stringlength it prints out is 0 (zero). So obviously there is something wrong. I have concluded that the ciphered text is not being stored into the cprtxt[] array. Any ideas why?

Thanks.