3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'a16byteslongkey!'; $data = base64_decode('LsCH4nvvGPKN67v94Ig9BweQgOk9rtDdK7ZugeJkTS8='); $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $iv = substr($data, 0, $iv_size); function aes256_cbc_decrypt($key, $data, $iv) { if (32 !== strlen($key)) { $key = hash('SHA256', $key, true); } if (16 !== strlen($iv)) { $iv = hash('MD5', $iv, true); } $data = mcrypt_decrypt( MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, $iv ); $padding = ord($data[strlen($data) - 1]); return substr($data, 0, -$padding); } $result = aes256_cbc_decrypt($key,$data,$iv); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PDAAQ
function name:  (null)
number of ops:  28
compiled vars:  !0 = $key, !1 = $data, !2 = $iv_size, !3 = $iv, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'a16byteslongkey%21'
    4     1        INIT_FCALL                                               'base64_decode'
          2        SEND_VAL                                                 'LsCH4nvvGPKN67v94Ig9BweQgOk9rtDdK7ZugeJkTS8%3D'
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    5     5        INIT_FCALL_BY_NAME                                       'mcrypt_get_iv_size'
          6        FETCH_CONSTANT                                   ~8      'MCRYPT_RIJNDAEL_128'
          7        SEND_VAL_EX                                              ~8
          8        FETCH_CONSTANT                                   ~9      'MCRYPT_MODE_CBC'
          9        SEND_VAL_EX                                              ~9
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !2, $10
    6    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 0
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !3, $12
   27    18        INIT_FCALL                                               'aes256_cbc_decrypt'
         19        SEND_VAR                                                 !0
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !3
         22        DO_FCALL                                      0  $14     
         23        ASSIGN                                                   !4, $14
   28    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Function aes256_cbc_decrypt:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 12
filename:       /in/PDAAQ
function name:  aes256_cbc_decrypt
number of ops:  46
compiled vars:  !0 = $key, !1 = $data, !2 = $iv, !3 = $padding
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   10     3        STRLEN                                           ~4      !0
          4        IS_NOT_IDENTICAL                                         ~4, 32
          5      > JMPZ                                                     ~5, ->12
   11     6    >   INIT_FCALL                                               'hash'
          7        SEND_VAL                                                 'SHA256'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !0, $6
   13    12    >   STRLEN                                           ~8      !2
         13        IS_NOT_IDENTICAL                                         ~8, 16
         14      > JMPZ                                                     ~9, ->21
   14    15    >   INIT_FCALL                                               'hash'
         16        SEND_VAL                                                 'MD5'
         17        SEND_VAR                                                 !2
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !2, $10
   16    21    >   INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
   17    22        FETCH_CONSTANT                                   ~12     'MCRYPT_RIJNDAEL_128'
         23        SEND_VAL_EX                                              ~12
         24        SEND_VAR_EX                                              !0
         25        SEND_VAR_EX                                              !1
   20    26        FETCH_CONSTANT                                   ~13     'MCRYPT_MODE_CBC'
         27        SEND_VAL_EX                                              ~13
   17    28        SEND_VAR_EX                                              !2
         29        DO_FCALL                                      0  $14     
   16    30        ASSIGN                                                   !1, $14
   23    31        INIT_FCALL                                               'ord'
         32        STRLEN                                           ~16     !1
         33        SUB                                              ~17     ~16, 1
         34        FETCH_DIM_R                                      ~18     !1, ~17
         35        SEND_VAL                                                 ~18
         36        DO_ICALL                                         $19     
         37        ASSIGN                                                   !3, $19
   24    38        INIT_FCALL                                               'substr'
         39        SEND_VAR                                                 !1
         40        SEND_VAL                                                 0
         41        MUL                                              ~21     !3, -1
         42        SEND_VAL                                                 ~21
         43        DO_ICALL                                         $22     
         44      > RETURN                                                   $22
   25    45*     > RETURN                                                   null

End of function aes256_cbc_decrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.59 ms | 1403 KiB | 24 Q