3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tempToken = "cecf180d-800e-43ee-82b5-2b22db814d9098b3bf2a-b5bd-4800-ac75-3e29d72b6155"; $clearText = "AuthToken=cecf180d-800e-43ee-82b5-2b22db814d9098b3bf2a-b5bd-4800-ac75-3e29d72b6155&PayerId=9979571404994689&PaymentProcessType=CreditCard&ProcessMethod=None&PaymentMethodStorageOption=None&ReturnURL=https://il01addproc.propay.com:443/Return.aspx "; // 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;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HkZcs
function name:  (null)
number of ops:  49
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
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'cecf180d-800e-43ee-82b5-2b22db814d9098b3bf2a-b5bd-4800-ac75-3e29d72b6155'
    4     1        ASSIGN                                                   !1, 'AuthToken%3Dcecf180d-800e-43ee-82b5-2b22db814d9098b3bf2a-b5bd-4800-ac75-3e29d72b6155%26PayerId%3D9979571404994689%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'
    7     2        INIT_FCALL                                               'utf8_encode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $11     
          5        ASSIGN                                                   !2, $11
   10     6        INIT_FCALL                                               'md5'
          7        SEND_VAR                                                 !2
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $13     
         10        ASSIGN                                                   !3, $13
   13    11        INIT_FCALL                                               'utf8_encode'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $15     
         14        ASSIGN                                                   !4, $15
   16    15        INIT_FCALL_BY_NAME                                       'mcrypt_get_block_size'
         16        SEND_VAL_EX                                              'rijndael_128'
         17        SEND_VAL_EX                                              'cbc'
         18        DO_FCALL                                      0  $17     
         19        ASSIGN                                                   !5, $17
   17    20        STRLEN                                           ~19     !4
         21        MOD                                              ~20     ~19, !5
         22        SUB                                              ~21     !5, ~20
         23        ASSIGN                                                   !6, ~21
   18    24        INIT_FCALL                                               'str_repeat'
         25        INIT_FCALL                                               'chr'
         26        SEND_VAR                                                 !6
         27        DO_ICALL                                         $23     
         28        SEND_VAR                                                 $23
         29        SEND_VAR                                                 !6
         30        DO_ICALL                                         $24     
         31        CONCAT                                           ~25     !4, $24
         32        ASSIGN                                                   !4, ~25
   21    33        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
         34        FETCH_CONSTANT                                   ~27     'MCRYPT_RIJNDAEL_128'
         35        SEND_VAL_EX                                              ~27
         36        SEND_VAR_EX                                              !3
         37        SEND_VAR_EX                                              !4
         38        FETCH_CONSTANT                                   ~28     'MCRYPT_MODE_CBC'
         39        SEND_VAL_EX                                              ~28
         40        SEND_VAR_EX                                              !3
         41        DO_FCALL                                      0  $29     
         42        ASSIGN                                                   !7, $29
   24    43        INIT_FCALL                                               'base64_encode'
         44        SEND_VAR                                                 !7
         45        DO_ICALL                                         $31     
         46        ASSIGN                                                   !8, $31
   26    47        ECHO                                                     !8
         48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.19 ms | 1400 KiB | 23 Q