I'm having some troubles with xor operator.
I have a visual basic application that has a function whit this line:
numeroCaracter = Asc(password.Substring(contador, 1)) Xor Asc(CadenaEncriptacion.Substring(contador, 1))
password is a string that is received by the function, and CadenaEncriptacion is this constant:
Private Const CadenaEncriptacion As String = "eNcRiPtAcIoNmUyChUlAyGuAyDeLpArAgUaYeNcRiPtAcIoNmUyChUlAyGuAyDeLpArAgUaYeNcRiPtAcIoNmUyChUlAyGuAyDeLpArAgUaYeNcRiPtAcIoNmUyChUlAyGuAyDeLpArAgUaY"
I need translate the function to PHP, I traslated that line on this way:
$numeroCaracter = ord(substr($password, $contador, 1)) xor ord(substr($CadenaEncriptacion, $contador, 1));
The ord function in PHP and Asc in vb are giving the same values in both languages, but numeroCaracter has diferent value in PHP and VB, by the XOR operator...
In php numeroCaracer is always the ord value to each character, in vb the asc function give me other value.
Thanks!