3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tempToken = "eb97ed62-ef2b-4f4d-973a-a492a5a74f694d9297e2-ffef-4ee8-8df4-ffabdac2e3f0"; $clearText = "AuthToken=eb97ed62-ef2b-4f4d-973a-a492a5a74f694d9297e2-ffef-4ee8-8df4-ffabdac2e3f0&PayerId=2651346885082349&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;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A2BUh
function name:  (null)
number of ops:  69
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, 'eb97ed62-ef2b-4f4d-973a-a492a5a74f694d9297e2-ffef-4ee8-8df4-ffabdac2e3f0'
    6     1        ASSIGN                                                   !1, 'AuthToken%3Deb97ed62-ef2b-4f4d-973a-a492a5a74f694d9297e2-ffef-4ee8-8df4-ffabdac2e3f0%26PayerId%3D2651346885082349%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'
   10     2        INIT_FCALL                                               'md5'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $11     
          5        CONCAT                                           ~12     $11, '%0A'
          6        ECHO                                                     ~12
   13     7        INIT_FCALL                                               'utf8_encode'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $13     
         10        ASSIGN                                                   !2, $13
   16    11        INIT_FCALL                                               'md5'
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $15     
         15        ASSIGN                                                   !3, $15
   19    16        INIT_FCALL                                               'utf8_encode'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $17     
         19        ASSIGN                                                   !4, $17
   22    20        INIT_FCALL                                               'md5'
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                         $19     
         23        CONCAT                                           ~20     $19, '%0A'
         24        ECHO                                                     ~20
   25    25        INIT_FCALL_BY_NAME                                       'mcrypt_get_block_size'
         26        SEND_VAL_EX                                              'rijndael_128'
         27        SEND_VAL_EX                                              'cbc'
         28        DO_FCALL                                      0  $21     
         29        ASSIGN                                                   !5, $21
   26    30        STRLEN                                           ~23     !4
         31        MOD                                              ~24     ~23, !5
         32        SUB                                              ~25     !5, ~24
         33        ASSIGN                                                   !6, ~25
   27    34        INIT_FCALL                                               'str_repeat'
         35        INIT_FCALL                                               'chr'
         36        SEND_VAR                                                 !6
         37        DO_ICALL                                         $27     
         38        SEND_VAR                                                 $27
         39        SEND_VAR                                                 !6
         40        DO_ICALL                                         $28     
         41        CONCAT                                           ~29     !4, $28
         42        ASSIGN                                                   !4, ~29
   29    43        INIT_FCALL                                               'md5'
         44        SEND_VAR                                                 !4
         45        DO_ICALL                                         $31     
         46        CONCAT                                           ~32     $31, '%0A'
         47        ECHO                                                     ~32
   32    48        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
         49        FETCH_CONSTANT                                   ~33     'MCRYPT_RIJNDAEL_128'
         50        SEND_VAL_EX                                              ~33
         51        SEND_VAR_EX                                              !3
         52        SEND_VAR_EX                                              !4
         53        FETCH_CONSTANT                                   ~34     'MCRYPT_MODE_CBC'
         54        SEND_VAL_EX                                              ~34
         55        SEND_VAR_EX                                              !3
         56        DO_FCALL                                      0  $35     
         57        ASSIGN                                                   !7, $35
   34    58        INIT_FCALL                                               'md5'
         59        SEND_VAR                                                 !7
         60        DO_ICALL                                         $37     
         61        CONCAT                                           ~38     $37, '%0A'
         62        ECHO                                                     ~38
   37    63        INIT_FCALL                                               'base64_encode'
         64        SEND_VAR                                                 !7
         65        DO_ICALL                                         $39     
         66        ASSIGN                                                   !8, $39
   39    67        ECHO                                                     !8
         68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.92 ms | 1392 KiB | 23 Q