3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tempToken = "eb9b5214-a941-44bf-afec-04e398b0a356e52ceeb1-5495-4287-b955-cd34413728ab"; $clearText = "AuthToken=eb9b5214-a941-44bf-afec-04e398b0a356e52ceeb1-5495-4287-b955-cd34413728ab&PayerId=2432991646479390&PaymentProcessType=CreditCard&ProcessMethod=None&PaymentMethodStorageOption=None&ReturnURL=https://il01addproc.propay.com:443/Return.aspx "; // $tempToken = "1f25d31c-e8fe-4d68-be73-f7b439bfa0a329e90de6-4e93-4374-8633-22cef77467f5"; // $clearText = "AuthToken=1f25d31c-e8fe-4d68-be73-f7b439bfa0a329e90de6-4e93-4374-8633-22cef77467f5&PayerID=2833955147881261&Amount=10.00&CurrencyCode=USD&ProcessMethod=Capture&PaymentMethodStorageOption=None&InvoiceNumber=Invoice123&Comment1=comment1&Comment2=comment2&echo=echotest&ReturnURL=https://il01addproc.propay.com:443/Return.aspx&ProfileId=3351&PaymentProcessType=CreditCard&StandardEntryClassCode=&DisplayMessage=True&Protected=False"; echo md5($clearText) . "\n"; // Encode the TempToken string in UTF-8 $encodedTempToken = utf8_encode($tempToken); // Get the MD5 hash of $encodedTempToken in raw binary format with a length of 16 $md5Hash = md5($encodedTempToken, TRUE); // Encode the name value string in UTF-8 $encodedNameValueString = utf8_encode($clearText); echo md5($encodedNameValueString) . "\n"; // Pad the name value string using pkcs5_pad $blocksize = mcrypt_get_block_size('rijndael_128', 'cbc'); $pad = $blocksize - (strlen($encodedNameValueString) % $blocksize); $encodedNameValueString = $encodedNameValueString . str_repeat(chr($pad), $pad); echo md5($encodedNameValueString) . "\n"; // Use AES-128 encryption to encrypt the name value string with the key and IV both being equal to the MD5 hash of $encodedTempToken $aes128 = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $md5Hash, $encodedNameValueString, MCRYPT_MODE_CBC, $md5Hash); echo md5($aes128) . "\n"; // Use Base64 encoding to send the resulting bytes of the encrypted name value string $settingsCipher = base64_encode($aes128); echo $settingsCipher;
Output for 7.0.6 - 7.1.0
299cdf08cb7fbc63d2672507954edc8b 299cdf08cb7fbc63d2672507954edc8b Fatal error: Uncaught Error: Call to undefined function mcrypt_get_block_size() in /in/2faoR:25 Stack trace: #0 {main} thrown in /in/2faoR on line 25
Process exited with code 255.
Output for 5.4.0 - 5.5.34, 5.6.0 - 5.6.20, 7.0.0 - 7.0.5
299cdf08cb7fbc63d2672507954edc8b 299cdf08cb7fbc63d2672507954edc8b b884917b61925e7d3cedd79ff665b6db d9ad6423299a4ff151c5af1f1e0ac14a jtwSOMAIi+VA2o69iRIh3G/1sGBCt2Sjup8VfDGvpbM91TgauPRJp5HC6iUy7vJpqS1Ui5QfXqzmohUUWxYjIa3zAyEFpCDgsGtcXj1tEEg8N9LhY4fL8/e7nnLZUis4TDATQavG1f9gSJkrQ/mql4BPKhBNg2j7SVnAzXel0urYdIkXooSGTVWuF+SQNA40TBA8W1MaLDAmfGR9oMteowhGStHY09w8Kg+GWGv8796ycDrhLRtMHAYKBEO09vzjX4erbv4Xmc7R3voY268KNPIgPRi4sHjAKj8naoinRn7OGVDknsoDuihPvS2+dWvYoZ5065v83jhTAFv5QOevgfMQQu6eWa/oLPDXlXwNsQU=
Output for 5.0.0 - 5.3.29, 5.5.35 - 5.5.38, 5.6.21 - 5.6.28
299cdf08cb7fbc63d2672507954edc8b 299cdf08cb7fbc63d2672507954edc8b Fatal error: Call to undefined function mcrypt_get_block_size() in /in/2faoR on line 25
Process exited with code 255.
Output for 4.4.5 - 4.4.9
299cdf08cb7fbc63d2672507954edc8b Warning: Wrong parameter count for md5() in /in/2faoR on line 16 299cdf08cb7fbc63d2672507954edc8b Fatal error: Call to undefined function: mcrypt_get_block_size() in /in/2faoR on line 25
Process exited with code 255.
Output for 4.3.2 - 4.4.4
299cdf08cb7fbc63d2672507954edc8b Warning: Wrong parameter count for md5() in /in/2faoR on line 16 299cdf08cb7fbc63d2672507954edc8b Fatal error: Call to undefined function: mcrypt_get_block_size() in /in/2faoR on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1
299cdf08cb7fbc63d2672507954edc8b Warning: Wrong parameter count for md5() in /in/2faoR on line 16 299cdf08cb7fbc63d2672507954edc8b Fatal error: Call to undefined function: mcrypt_get_block_size() in /in/2faoR on line 25