Although I’ve used C++ a lot, I’m struggling with the C differences (mainly in strings).
Could you please show me a simple single function that encrypts a message with a key using XOR comparison.
Thank-you
EDIT:
Both the key and the message are char*
OK, I hacked around for a minute and came up with this (only vaguely tested):
Note that the function
xorencryptallocates and returns a new string, so it’s the caller’s responsibility to free it when done.