<?php
$iv = "00000000000000000000000000000000";
$key = "00000000000000000000000000000000";
$picc= "CACDEC6C5455EE52BB1DA40470963113";
// 112233445566778899
// AES-Entschlüsselung im CBC-Modus
$encrypted_data = hex2bin($encrypted_data);
$decrypted_data = openssl_decrypt($picc, 'aes-128-cbc', $key, $iv);
// Extrahieren des Zählerwerts
$byte9 = ord($picc[9]); // 10. Byte (Index 9) $byte8 = ord($picc[8]); // 9. Byte (Index 8) $counter = ($byte9 << 8) | $byte8; // Zusammenfügen der Bytes (Big-Endian)
echo "Ergebnis: $decrypted_data\n";
echo "$picc\n";
echo "Counter: $counter\n";
?>
PD9waHAKJGl2ICA9ICIwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMCI7CiRrZXkgPSAiMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiOwokcGljYz0gIkNBQ0RFQzZDNTQ1NUVFNTJCQjFEQTQwNDcwOTYzMTEzIjsKLy8gICAgICAgMTEyMjMzNDQ1NTY2Nzc4ODk5Ci8vIEFFUy1FbnRzY2hsw7xzc2VsdW5nIGltIENCQy1Nb2R1cwokZW5jcnlwdGVkX2RhdGEgPSBoZXgyYmluKCRlbmNyeXB0ZWRfZGF0YSk7CiRkZWNyeXB0ZWRfZGF0YSA9IG9wZW5zc2xfZGVjcnlwdCgkcGljYywgJ2Flcy0xMjgtY2JjJywgJGtleSwgJGl2KTsKCgovLyBFeHRyYWhpZXJlbiBkZXMgWsOkaGxlcndlcnRzCiRieXRlOSA9IG9yZCgkcGljY1s5XSk7IC8vIDEwLiBCeXRlIChJbmRleCA5KQokYnl0ZTggPSBvcmQoJHBpY2NbOF0pOyAvLyA5LiBCeXRlIChJbmRleCA4KQokY291bnRlciA9ICgkYnl0ZTkgPDwgOCkgfCAkYnl0ZTg7IC8vIFp1c2FtbWVuZsO8Z2VuIGRlciBCeXRlcyAoQmlnLUVuZGlhbikKCmVjaG8gIkVyZ2VibmlzOiAkZGVjcnlwdGVkX2RhdGFcbiI7CmVjaG8gIiRwaWNjXG4iOwplY2hvICJDb3VudGVyOiAkY291bnRlclxuIjsKPz4K