2 Attachment(s)
XOR encryption using CString
ive been trying to figure out how to do a basic XOR encryption with CStrings but i have errors
im having trouble with the for loop character counter. the code i have to count the number of characters in the CString returns an error from a header file atlsimpstr.h
my code function and error window are as follows:
Attachment 34001Attachment 34003
Re: XOR encryption using CString
Where is the bound of the m_output string set and to what value?
How do you know that m_display has at least m_masterkey.GetLength() chars?
Consider
Code:
m_output = "";
for (int i = 0; i < m_masterkey.GetLength() && i < m_display.GetLength(); i++)
m_output += m_display.GetAt(i) ^ m_masterkey.GetAt(i);