I have created a function based upon something from VB6 which allows me to encrypt/decrypt some basic information. The encryption works fine but when I attempt to use the same function to decrypt not all characters are converted correctly.
I can not change the encryption method from this Xor method as the data which is encrypted is used by many programs written in different languages. Hence I have adopted it from VB6.
Any ideas why it would encrypt OK but have problems decrypting?? Any help greatly appreciated.
public static string EncryptPW(string p)
string strResult = "";
for (int i = 0; i < p.Length; i++)
testChar = Convert.ToChar(p.Substring(i, 1));
strResult += (char)(testChar ^ 255);