3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class SensitiveInfo { private $cipher = "AES-256-CBC"; private $secret_key = "fj239fDSDf932kk21c"; private $secret_iv = "3fn4d2k3j3nxdlpo32"; private $options = 0; private $iv = null; public function __construct() { $this->secret_key = hash('sha256', $this->secret_key); $this->iv = substr(hash('sha256', $this->secret_iv), 0, 16); }//end __construct() public function hide(string $str): string { return base64_encode(openssl_encrypt( $str, $this->cipher, $this->secret_key, $this->options, $this->iv )); }//end maskData() public function unhide(string $str) { $str = base64_decode($str); return openssl_decrypt( $str, $this->cipher, $this->secret_key, $this->options, $this->iv ); }//end maskData() }//end class $si = new SensitiveInfo(); $encrypted = $si->hide("Hello World"); var_dump($encrypted); var_dump($si->unhide($encrypted));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xi5WF
function name:  (null)
number of ops:  17
compiled vars:  !0 = $si, !1 = $encrypted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   NEW                                              $2      'SensitiveInfo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   48     3        INIT_METHOD_CALL                                         !0, 'hide'
          4        SEND_VAL_EX                                              'Hello+World'
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !1, $5
   49     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   51    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !0, 'unhide'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0  $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class SensitiveInfo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xi5WF
function name:  __construct
number of ops:  20
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'hash'
          1        SEND_VAL                                                 'sha256'
          2        FETCH_OBJ_R                                      ~1      'secret_key'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        ASSIGN_OBJ                                               'secret_key'
          6        OP_DATA                                                  $2
   21     7        INIT_FCALL                                               'substr'
          8        INIT_FCALL                                               'hash'
          9        SEND_VAL                                                 'sha256'
         10        FETCH_OBJ_R                                      ~4      'secret_iv'
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 16
         16        DO_ICALL                                         $6      
         17        ASSIGN_OBJ                                               'iv'
         18        OP_DATA                                                  $6
   23    19      > RETURN                                                   null

End of function __construct

Function hide:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xi5WF
function name:  hide
number of ops:  23
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   28     1        INIT_FCALL                                               'base64_encode'
          2        INIT_FCALL_BY_NAME                                       'openssl_encrypt'
   29     3        SEND_VAR_EX                                              !0
          4        CHECK_FUNC_ARG                                           
          5        FETCH_OBJ_FUNC_ARG                               $1      'cipher'
          6        SEND_FUNC_ARG                                            $1
          7        CHECK_FUNC_ARG                                           
          8        FETCH_OBJ_FUNC_ARG                               $2      'secret_key'
          9        SEND_FUNC_ARG                                            $2
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $3      'options'
         12        SEND_FUNC_ARG                                            $3
         13        CHECK_FUNC_ARG                                           
         14        FETCH_OBJ_FUNC_ARG                               $4      'iv'
         15        SEND_FUNC_ARG                                            $4
         16        DO_FCALL                                      0  $5      
         17        SEND_VAR                                                 $5
         18        DO_ICALL                                         $6      
         19        VERIFY_RETURN_TYPE                                       $6
         20      > RETURN                                                   $6
   32    21*       VERIFY_RETURN_TYPE                                       
         22*     > RETURN                                                   null

End of function hide

Function unhide:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xi5WF
function name:  unhide
number of ops:  22
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   37     1        INIT_FCALL                                               'base64_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   38     5        INIT_FCALL_BY_NAME                                       'openssl_decrypt'
   39     6        SEND_VAR_EX                                              !0
          7        CHECK_FUNC_ARG                                           
          8        FETCH_OBJ_FUNC_ARG                               $3      'cipher'
          9        SEND_FUNC_ARG                                            $3
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $4      'secret_key'
         12        SEND_FUNC_ARG                                            $4
         13        CHECK_FUNC_ARG                                           
         14        FETCH_OBJ_FUNC_ARG                               $5      'options'
         15        SEND_FUNC_ARG                                            $5
         16        CHECK_FUNC_ARG                                           
         17        FETCH_OBJ_FUNC_ARG                               $6      'iv'
         18        SEND_FUNC_ARG                                            $6
         19        DO_FCALL                                      0  $7      
         20      > RETURN                                                   $7
   42    21*     > RETURN                                                   null

End of function unhide

End of class SensitiveInfo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.39 ms | 1404 KiB | 23 Q