3v4l.org

run code in 300+ PHP versions simultaneously
<?php $secret = md5(NULL); function encrypt128($str, $secret) { $block = 16; $pad = $block - (strlen($str) % $block); $str .= str_repeat(chr($pad), $pad); return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $secret, $str, MCRYPT_MODE_ECB)); } function sslEncrypt128($str, $secret) { $str = base64_encode($str); $pad = 16 - (strlen($str) % 16); $str = ($pad != 16) ? $str . str_repeat(chr($pad), $pad) : $str; return base64_encode(openssl_encrypt($str, 'aes-256-ecb', $secret, OPENSSL_RAW_DATA)); } var_dump(encrypt128(base64_encode('proba'), $secret)); var_dump(sslEncrypt128('proba', $secret));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkfmM
function name:  (null)
number of ops:  22
compiled vars:  !0 = $secret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'md5'
          1        SEND_VAL                                                 null
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
   22     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'encrypt128'
          6        INIT_FCALL                                               'base64_encode'
          7        SEND_VAL                                                 'proba'
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0  $4      
         12        SEND_VAR                                                 $4
         13        DO_ICALL                                                 
   23    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'sslencrypt128'
         16        SEND_VAL                                                 'proba'
         17        SEND_VAR                                                 !0
         18        DO_FCALL                                      0  $6      
         19        SEND_VAR                                                 $6
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function encrypt128:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkfmM
function name:  encrypt128
number of ops:  28
compiled vars:  !0 = $str, !1 = $secret, !2 = $block, !3 = $pad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        ASSIGN                                                   !2, 16
    8     3        STRLEN                                           ~5      !0
          4        MOD                                              ~6      ~5, !2
          5        SUB                                              ~7      !2, ~6
          6        ASSIGN                                                   !3, ~7
    9     7        INIT_FCALL                                               'str_repeat'
          8        INIT_FCALL                                               'chr'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $9      
         11        SEND_VAR                                                 $9
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $10     
         14        ASSIGN_OP                                     8          !0, $10
   11    15        INIT_FCALL                                               'base64_encode'
         16        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
         17        FETCH_CONSTANT                                   ~12     'MCRYPT_RIJNDAEL_128'
         18        SEND_VAL_EX                                              ~12
         19        SEND_VAR_EX                                              !1
         20        SEND_VAR_EX                                              !0
         21        FETCH_CONSTANT                                   ~13     'MCRYPT_MODE_ECB'
         22        SEND_VAL_EX                                              ~13
         23        DO_FCALL                                      0  $14     
         24        SEND_VAR                                                 $14
         25        DO_ICALL                                         $15     
         26      > RETURN                                                   $15
   12    27*     > RETURN                                                   null

End of function encrypt128

Function sslencrypt128:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkfmM
function name:  sslEncrypt128
number of ops:  36
compiled vars:  !0 = $str, !1 = $secret, !2 = $pad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_FCALL                                               'base64_encode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
   17     6        STRLEN                                           ~5      !0
          7        MOD                                              ~6      ~5, 16
          8        SUB                                              ~7      16, ~6
          9        ASSIGN                                                   !2, ~7
   18    10        IS_NOT_EQUAL                                             !2, 16
         11      > JMPZ                                                     ~9, ->22
         12    >   INIT_FCALL                                               'str_repeat'
         13        INIT_FCALL                                               'chr'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $10     
         16        SEND_VAR                                                 $10
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     !0, $11
         20        QM_ASSIGN                                        ~13     ~12
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~13     !0
         23    >   ASSIGN                                                   !0, ~13
   19    24        INIT_FCALL                                               'base64_encode'
         25        INIT_FCALL_BY_NAME                                       'openssl_encrypt'
         26        SEND_VAR_EX                                              !0
         27        SEND_VAL_EX                                              'aes-256-ecb'
         28        SEND_VAR_EX                                              !1
         29        FETCH_CONSTANT                                   ~15     'OPENSSL_RAW_DATA'
         30        SEND_VAL_EX                                              ~15
         31        DO_FCALL                                      0  $16     
         32        SEND_VAR                                                 $16
         33        DO_ICALL                                         $17     
         34      > RETURN                                                   $17
   20    35*     > RETURN                                                   null

End of function sslencrypt128

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.26 ms | 1407 KiB | 25 Q