fork download
  1. <?php
  2. $iv = "00000000000000000000000000000000";
  3. $key = "00000000000000000000000000000000";
  4. $picc= "CACDEC6C5455EE52BB1DA40470963113";
  5. // 112233445566778899
  6. // AES-Entschlüsselung im CBC-Modus
  7. $encrypted_data = hex2bin($encrypted_data);
  8. $decrypted_data = openssl_decrypt($picc, 'aes-128-cbc', $key, $iv);
  9.  
  10.  
  11. // Extrahieren des Zählerwerts
  12. $byte9 = ord($picc[9]); // 10. Byte (Index 9)
  13. $byte8 = ord($picc[8]); // 9. Byte (Index 8)
  14. $counter = ($byte9 << 8) | $byte8; // Zusammenfügen der Bytes (Big-Endian)
  15.  
  16. echo "Ergebnis: $decrypted_data\n";
  17. echo "$picc\n";
  18. echo "Counter: $counter\n";
  19. ?>
  20.  
Success #stdin #stdout #stderr 0.03s 25860KB
stdin
Standard input is empty
stdout
Ergebnis: 
CACDEC6C5455EE52BB1DA40470963113
Counter: 13365
stderr
PHP Notice:  Undefined variable: encrypted_data in /home/qpTixb/prog.php on line 7