<?php
function decryptAES($picc, $key, $iv) {
// Wandelt den hexadezimalen String in binäre Daten um
$piccBinary = hex2bin($picc);
// Entschlüsselt die Daten mit AES-128-CBC
$decryptedData = openssl_decrypt($piccBinary, 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $iv);
// Wandelt die entschlüsselten Daten in einen hexadezimalen String um
}
// Initialisierung der Parameter
$key = "00000000000000000000000000000000";
$picc = "EF963FF7828658A599F3041510671E88";
// Aufruf der Funktion
$result = decryptAES($picc, $key, $iv);
echo "iv: $iv\n";
echo "picc: $picc\n";
echo "Ergebnis: $result\n"
?>
PD9waHAKZnVuY3Rpb24gZGVjcnlwdEFFUygkcGljYywgJGtleSwgJGl2KSB7CiAgICAvLyBXYW5kZWx0IGRlbiBoZXhhZGV6aW1hbGVuIFN0cmluZyBpbiBiaW7DpHJlIERhdGVuIHVtCiAgICAkcGljY0JpbmFyeSA9IGhleDJiaW4oJHBpY2MpOwogICAgCiAgICAvLyBFbnRzY2hsw7xzc2VsdCBkaWUgRGF0ZW4gbWl0IEFFUy0xMjgtQ0JDCiAgICAkZGVjcnlwdGVkRGF0YSA9IG9wZW5zc2xfZGVjcnlwdCgkcGljY0JpbmFyeSwgJ0FFUy0xMjgtQ0JDJywgJGtleSwgT1BFTlNTTF9SQVdfREFUQSwgJGl2KTsKICAgIAogICAgLy8gV2FuZGVsdCBkaWUgZW50c2NobMO8c3NlbHRlbiBEYXRlbiBpbiBlaW5lbiBoZXhhZGV6aW1hbGVuIFN0cmluZyB1bQogICAgcmV0dXJuIGJpbjJoZXgoJGRlY3J5cHRlZERhdGEpOwp9CgovLyBJbml0aWFsaXNpZXJ1bmcgZGVyIFBhcmFtZXRlcgokaXYgPSBzdHJfcmVwZWF0KCJceDAwIiwgMTYpOyAvLyAxNiBOdWxsZW4KJGtleSA9ICIwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMCI7CiRwaWNjID0gIkVGOTYzRkY3ODI4NjU4QTU5OUYzMDQxNTEwNjcxRTg4IjsKCi8vIEF1ZnJ1ZiBkZXIgRnVua3Rpb24KJHJlc3VsdCA9IGRlY3J5cHRBRVMoJHBpY2MsICRrZXksICRpdik7CmVjaG8gIml2OiAkaXZcbiI7CmVjaG8gInBpY2M6ICRwaWNjXG4iOwplY2hvICJFcmdlYm5pczogJHJlc3VsdFxuIgo/Pgo=