3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ''; $pw = '7._&~+rTVrGhL3Qis-FO2hNli<=3%(]f'; // Set a random salt $salt = openssl_random_pseudo_bytes(8); $salted = ''; $dx = ''; // Salt the key(32) and iv(16) = 48 while (strlen($salted) < 48) { $dx = md5($dx.$password.$salt, true); $salted .= $dx; } $key = substr($salted, 0, 32); $iv = substr($salted, 32, 16); if (! strlen($data)) { $encrypted_data = openssl_encrypt($data, 'aes-256-cbc', $key, true, $iv); var_dump( 'Salted__' . $salt . $encrypted_data); die('***'); } //$encrypted_data = openssl_encrypt($data, 'aes-256-cbc', $key, true, $iv); //print base64_encode('Salted__' . $salt . $encrypted_data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 9
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 49
Branch analysis from position: 35
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 9
Branch analysis from position: 20
Branch analysis from position: 9
filename:       /in/eNriR
function name:  (null)
number of ops:  50
compiled vars:  !0 = $data, !1 = $pw, !2 = $salt, !3 = $salted, !4 = $dx, !5 = $password, !6 = $key, !7 = $iv, !8 = $encrypted_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, ''
    3     1        ASSIGN                                                   !1, '7._%26%7E%2BrTVrGhL3Qis-FO2hNli%3C%3D3%25%28%5Df'
    6     2        INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
          3        SEND_VAL_EX                                              8
          4        DO_FCALL                                      0  $11     
          5        ASSIGN                                                   !2, $11
    8     6        ASSIGN                                                   !3, ''
    9     7        ASSIGN                                                   !4, ''
   11     8      > JMP                                                      ->17
   12     9    >   INIT_FCALL                                               'md5'
         10        CONCAT                                           ~15     !4, !5
         11        CONCAT                                           ~16     ~15, !2
         12        SEND_VAL                                                 ~16
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $17     
         15        ASSIGN                                                   !4, $17
   13    16        ASSIGN_OP                                     8          !3, !4
   11    17    >   STRLEN                                           ~20     !3
         18        IS_SMALLER                                               ~20, 48
         19      > JMPNZ                                                    ~21, ->9
   16    20    >   INIT_FCALL                                               'substr'
         21        SEND_VAR                                                 !3
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 32
         24        DO_ICALL                                         $22     
         25        ASSIGN                                                   !6, $22
   17    26        INIT_FCALL                                               'substr'
         27        SEND_VAR                                                 !3
         28        SEND_VAL                                                 32
         29        SEND_VAL                                                 16
         30        DO_ICALL                                         $24     
         31        ASSIGN                                                   !7, $24
   19    32        STRLEN                                           ~26     !0
         33        BOOL_NOT                                         ~27     ~26
         34      > JMPZ                                                     ~27, ->49
   21    35    >   INIT_FCALL_BY_NAME                                       'openssl_encrypt'
         36        SEND_VAR_EX                                              !0
         37        SEND_VAL_EX                                              'aes-256-cbc'
         38        SEND_VAR_EX                                              !6
         39        SEND_VAL_EX                                              <true>
         40        SEND_VAR_EX                                              !7
         41        DO_FCALL                                      0  $28     
         42        ASSIGN                                                   !8, $28
   22    43        INIT_FCALL                                               'var_dump'
         44        CONCAT                                           ~30     'Salted__', !2
         45        CONCAT                                           ~31     ~30, !8
         46        SEND_VAL                                                 ~31
         47        DO_ICALL                                                 
   24    48      > EXIT                                                     '%2A%2A%2A'
   28    49    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.02 ms | 1400 KiB | 19 Q