Not actually PHP but in fact Perl/CGI. I'm just asking this question here because I couldn't get an answer anywhere else and I figured that most PHP programmers are CGI veterans.
Lately I've been playing around with data encryption using XOR. However when certain pairs of characters are XORed:
b - 01100010
x - 01111000
c - 01100011
y - 01111001
just to name a few, they all produce a result of:
and this character almost seems to act as a marker for the termination of any document. When decrypting a document that contains this character it will translate everything but that character and everything after it. It does the same thing if put into a perl script.
print '';
this will give an error because it can't find the string terminator. it basically seems to end the document from where ever it is. I've tried using pieces of code to escape this character without actually using it (to no success), such as:
$var =~ s/(b ^ x)/(b ^ (b ^ x))/g;
$var =~ s/(should produce )/(should translate into whatever character it should decrypt to, in this case 'x')/g;
I don't suppose anyone would have any idea of how to fix this problem of mine?