3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tempToken = "d6ed1a3c-51ff-48ea-be11-f579401cd7dfe37634fb-c00b-4069-ba12-d6e99d1a3e44"; $clearText = "AuthToken=d6ed1a3c-51ff-48ea-be11-f579401cd7dfe37634fb-c00b-4069-ba12-d6e99d1a3e44&PayerId=3439125637430349&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); 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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RUb36
function name:  (null)
number of ops:  63
compiled vars:  !0 = $tempToken, !1 = $clearText, !2 = $encodedTempToken, !3 = $md5Hash, !4 = $encodedNameValueString, !5 = $blocksize, !6 = $pad, !7 = $aes128, !8 = $settingsCipher
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'd6ed1a3c-51ff-48ea-be11-f579401cd7dfe37634fb-c00b-4069-ba12-d6e99d1a3e44'
    6     1        ASSIGN                                                   !1, 'AuthToken%3Dd6ed1a3c-51ff-48ea-be11-f579401cd7dfe37634fb-c00b-4069-ba12-d6e99d1a3e44%26PayerId%3D3439125637430349%26PaymentProcessType%3DCreditCard%26ProcessMethod%3DNone%26PaymentMethodStorageOption%3DNone%26ReturnURL%3Dhttps%3A%2F%2Fil01addproc.propay.com%3A443%2FReturn.aspx%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B%0B'
   13     2        INIT_FCALL                                               'utf8_encode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $11     
          5        ASSIGN                                                   !2, $11
   16     6        INIT_FCALL                                               'md5'
          7        SEND_VAR                                                 !2
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $13     
         10        ASSIGN                                                   !3, $13
   19    11        INIT_FCALL                                               'utf8_encode'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $15     
         14        ASSIGN                                                   !4, $15
   22    15        INIT_FCALL                                               'md5'
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                         $17     
         18        CONCAT                                           ~18     $17, '%0A'
         19        ECHO                                                     ~18
   25    20        INIT_FCALL_BY_NAME                                       'mcrypt_get_block_size'
         21        SEND_VAL_EX                                              'rijndael_128'
         22        SEND_VAL_EX                                              'cbc'
         23        DO_FCALL                                      0  $19     
         24        ASSIGN                                                   !5, $19
   26    25        STRLEN                                           ~21     !4
         26        MOD                                              ~22     ~21, !5
         27        SUB                                              ~23     !5, ~22
         28        ASSIGN                                                   !6, ~23
   27    29        INIT_FCALL                                               'str_repeat'
         30        INIT_FCALL                                               'chr'
         31        SEND_VAR                                                 !6
         32        DO_ICALL                                         $25     
         33        SEND_VAR                                                 $25
         34        SEND_VAR                                                 !6
         35        DO_ICALL                                         $26     
         36        CONCAT                                           ~27     !4, $26
         37        ASSIGN                                                   !4, ~27
   29    38        INIT_FCALL                                               'md5'
         39        SEND_VAR                                                 !4
         40        DO_ICALL                                         $29     
         41        CONCAT                                           ~30     $29, '%0A'
         42        ECHO                                                     ~30
   32    43        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
         44        FETCH_CONSTANT                                   ~31     'MCRYPT_RIJNDAEL_128'
         45        SEND_VAL_EX                                              ~31
         46        SEND_VAR_EX                                              !3
         47        SEND_VAR_EX                                              !4
         48        FETCH_CONSTANT                                   ~32     'MCRYPT_MODE_CBC'
         49        SEND_VAL_EX                                              ~32
         50        SEND_VAR_EX                                              !3
         51        DO_FCALL                                      0  $33     
         52        ASSIGN                                                   !7, $33
   34    53        INIT_FCALL                                               'md5'
         54        SEND_VAR                                                 !7
         55        DO_ICALL                                         $35     
         56        CONCAT                                           ~36     $35, '%0A'
         57        ECHO                                                     ~36
   37    58        INIT_FCALL                                               'base64_encode'
         59        SEND_VAR                                                 !7
         60        DO_ICALL                                         $37     
         61        ASSIGN                                                   !8, $37
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.99 ms | 1400 KiB | 23 Q