3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tempToken = "a55017c7-ce6a-4198-9af1-0c530c5d901f6f5f2cf2-c5e4-4dca-bc2f-80f3eb017de8"; $clearText = "AuthToken=a55017c7-ce6a-4198-9af1-0c530c5d901f6f5f2cf2-c5e4-4dca-bc2f-80f3eb017de8&PayerId=3356997047357992&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"; // 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); // 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); // 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); // 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
Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /in/s1OY4:26 Stack trace: #0 {main} thrown in /in/s1OY4 on line 26
Process exited with code 255.
Output for 5.4.0 - 5.5.34, 5.6.7 - 5.6.20, 7.0.0 - 7.0.5
oqXy58QTVK3hfTgtMZ7Fy4zKuZHHT7MoqRxFHqniK5sfRCH1rY2icU+vmOoOp6d4gdWedloYt+m/hyNMoxTw64pRCXSXnuyJnOOQ4Px0Vu7vTxO55EDSF7hreno49uv2oyox7WaTKIH6B9OlhOFkcnU2udbpRZ/kCD0WuGmutmn85w/N+Zjd01IRLEJIHK5doPdXjXMHtKQv69UUyDmjpd6eQlUGmehz8dF8SdCcS059sbpbhkQ9lbTmz8CpUJIc+lmS2oxUjfp2KVMyAqGDN8tqT9TzjCZEzGgSHEAT9zuDtkvBFiOK9GFB66+/bHIHAvB7lQvA1ztv90x+WiElqZzmDlbmjrSJpIut2XRCnsk=
Output for 5.0.0 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_encrypt() in /in/s1OY4 on line 26
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: Wrong parameter count for md5() in /in/s1OY4 on line 15 Fatal error: Call to undefined function: mcrypt_encrypt() in /in/s1OY4 on line 26
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Warning: Wrong parameter count for md5() in /in/s1OY4 on line 15 Fatal error: Call to undefined function: mcrypt_encrypt() in /in/s1OY4 on line 26
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for md5() in /in/s1OY4 on line 15 Fatal error: Call to undefined function: mcrypt_encrypt() in /in/s1OY4 on line 26