有人可以帮助我将XOR解密转换为PHP吗?
public static string DecryptKey(string key)
{
byte[] b = Convert.FromBase64String(key);
char[] arr = new char[b.Length];
for (int ii = 0; ii < b.Length; ii++)
{
arr[ii] = (char)(b[ii] ^ 14);
}
return new string(arr);
}
答案 0 :(得分:1)
完成它。谢谢您的帮助
public function DecryptKey($InputString) {
$InputString = base64_decode($string);
$retString='';
for ($j = 0; $j < strlen($InputString); $j++) {
$retString .= chr(ord(substr($InputString, $j, 1)) ^ 14);
}
return $retString;
}