3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tempToken = "ac7b7086-c6c6-4990-bf07-496a1462a53f34156ab3-6798-472f-b517-acdcf006c110"; $clearText = "AuthToken=ac7b7086-c6c6-4990-bf07-496a1462a53f34156ab3-6798-472f-b517-acdcf006c110&PayerId=3597720045321578&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
5e4c4cce3f61e5d26017d1e4a8bd207c 5e4c4cce3f61e5d26017d1e4a8bd207c Fatal error: Uncaught Error: Call to undefined function mcrypt_get_block_size() in /in/OMp3f:25 Stack trace: #0 {main} thrown in /in/OMp3f on line 25
Process exited with code 255.
Output for 5.4.34 - 5.5.34, 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
5e4c4cce3f61e5d26017d1e4a8bd207c 5e4c4cce3f61e5d26017d1e4a8bd207c 0e607cbdb4ff117740df9e5aa1b3fab1 43e62623c7354a5849ff4c20eb6c3d73 zqeoAFmptVhgOguv46jLUaElz8UBTIiDnTPBKJy7b1OsT8eLZ7CU9DcQa3pRurRFT3KutHnbyhyXT5yutXqVpewLIKD1pDmUFvzaOj+8cJ9UGdWrfVmNPEC790H4VpZmhu5KJIFqLvAjIF13kaKf9ZNdVapYGvt8g5nE2Gql/umSL2MdOorkDKZQPeaxv6r7ZZ+CglfkilU4/C5DfpELbOE+YTLv7b6gsc/px4/WjP9oFy0tMat4D0RD40kPEv9md3wwmgDGrzPvKvKamXvcZEDYUYHH1/nsxZRat3ifXVkgBvN2PryK4QeYMgAOafs3a2Kmb5AOCjrFTDrKhHym1MB2CcsT2khXAkyUvqB2+a4=
Output for 5.0.0 - 5.4.32, 5.5.35, 5.6.21 - 5.6.28
5e4c4cce3f61e5d26017d1e4a8bd207c 5e4c4cce3f61e5d26017d1e4a8bd207c Fatal error: Call to undefined function mcrypt_get_block_size() in /in/OMp3f on line 25
Process exited with code 255.
Output for 4.4.5 - 4.4.9
5e4c4cce3f61e5d26017d1e4a8bd207c Warning: Wrong parameter count for md5() in /in/OMp3f on line 16 5e4c4cce3f61e5d26017d1e4a8bd207c Fatal error: Call to undefined function: mcrypt_get_block_size() in /in/OMp3f on line 25
Process exited with code 255.
Output for 4.3.2 - 4.4.4
5e4c4cce3f61e5d26017d1e4a8bd207c Warning: Wrong parameter count for md5() in /in/OMp3f on line 16 5e4c4cce3f61e5d26017d1e4a8bd207c Fatal error: Call to undefined function: mcrypt_get_block_size() in /in/OMp3f on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1
5e4c4cce3f61e5d26017d1e4a8bd207c Warning: Wrong parameter count for md5() in /in/OMp3f on line 16 5e4c4cce3f61e5d26017d1e4a8bd207c Fatal error: Call to undefined function: mcrypt_get_block_size() in /in/OMp3f on line 25