Ver Mensaje Individual
  #5  
Antiguo 27-11-2007
Novás Novás is offline
Miembro
 
Registrado: oct 2003
Ubicación: Galicia
Posts: 146
Reputación: 21
Novás Va por buen camino
Realmente lo que necesito es traducir esta función de php a delphi
Código PHP:
<?
$pal_sec_ofuscada 
"5D;7F;0A;27;09;0D;25;5D;04;01;0B;00;06;01;00;70;06;1C;19;19";
$clave_xor "eH2dJ9gkB82915026***";

$cad1_0 "0";
$cad2_0 "00";
$cad3_0 "000";
$cad4_0 "0000";
$cad5_0 "00000";
$cad6_0 "000000";
$cad7_0 "0000000";
$cad8_0 "00000000";
$pal_sec "";

$valor rand (099);
$id_trans date("mdHis").$valor;
$localizador="1234567890";
$numtarjeta=$_POST["bbva_number"];
$fechacad="20" $_POST["bbva_expires"];
$importe $_POST["card_total"];
$trozos explode (";"$pal_sec_ofuscada);
$tope count($trozos);

for (
$i=0$i<$tope $i++)
{
    
$res "";
    
$pal_sec_ofus_bytes[$i] = decbin(hexdec($trozos[$i]));    
    if (
strlen($pal_sec_ofus_bytes[$i]) == 7){ $pal_sec_ofus_bytes[$i] = $cad1_0.$pal_sec_ofus_bytes[$i]; }    
    if (
strlen($pal_sec_ofus_bytes[$i]) == 6){ $pal_sec_ofus_bytes[$i] = $cad2_0.$pal_sec_ofus_bytes[$i]; }
    if (
strlen($pal_sec_ofus_bytes[$i]) == 5){ $pal_sec_ofus_bytes[$i] = $cad3_0.$pal_sec_ofus_bytes[$i]; }
    if (
strlen($pal_sec_ofus_bytes[$i]) == 4){ $pal_sec_ofus_bytes[$i] = $cad4_0.$pal_sec_ofus_bytes[$i]; }
    if (
strlen($pal_sec_ofus_bytes[$i]) == 3){ $pal_sec_ofus_bytes[$i] = $cad5_0.$pal_sec_ofus_bytes[$i]; }
    if (
strlen($pal_sec_ofus_bytes[$i]) == 2){ $pal_sec_ofus_bytes[$i] = $cad6_0.$pal_sec_ofus_bytes[$i]; }
    if (
strlen($pal_sec_ofus_bytes[$i]) == 1){ $pal_sec_ofus_bytes[$i] = $cad7_0.$pal_sec_ofus_bytes[$i]; }
    
$pal_sec_xor_bytes[$i] = decbin(ord($clave_xor[$i]));
    if (
strlen($pal_sec_xor_bytes[$i]) == 7){ $pal_sec_xor_bytes[$i] = $cad1_0.$pal_sec_xor_bytes[$i]; }
    if (
strlen($pal_sec_xor_bytes[$i]) == 6){ $pal_sec_xor_bytes[$i] = $cad2_0.$pal_sec_xor_bytes[$i]; }
    if (
strlen($pal_sec_xor_bytes[$i]) == 5){ $pal_sec_xor_bytes[$i] = $cad3_0.$pal_sec_xor_bytes[$i]; }
    if (
strlen($pal_sec_xor_bytes[$i]) == 4){ $pal_sec_xor_bytes[$i] = $cad4_0.$pal_sec_xor_bytes[$i]; }
    if (
strlen($pal_sec_xor_bytes[$i]) == 3){ $pal_sec_xor_bytes[$i] = $cad5_0.$pal_sec_xor_bytes[$i]; }
    if (
strlen($pal_sec_xor_bytes[$i]) == 2){ $pal_sec_xor_bytes[$i] = $cad6_0.$pal_sec_xor_bytes[$i]; }
    if (
strlen($pal_sec_xor_bytes[$i]) == 1){ $pal_sec_xor_bytes[$i] = $cad7_0.$pal_sec_xor_bytes[$i]; }
    for (
$j=0$j<8$j++)
    {
        (string)
$res .= (int)$pal_sec_ofus_bytes[$i][$j] ^ (int)$pal_sec_xor_bytes[$i][$j];
    }
    
$xor[$i] = $res;
    
$pal_sec .= chr(bindec($xor[$i]));
}
__________________
Hay dos cosas infinitas: el Universo y la estupidez humana. http://www.cybertarjetas.net
Responder Con Cita