3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decrypt ($str) { if(preg_match('%^[a-zA-Z0-9/+]*={0,2}$%',$str)) { $str = base64_decode($str); if ($str != "" && $str != null && $str != false) { $decStr = ""; for ($i=0; $i < strlen($str); $i+=3) { $array[$i/3] = substr($str,$i,3); } foreach($array as $s) { $a = $s^192; $decStr .= chr($a); } return $decStr; } return false; } return false; } echo decrypt("MTI5MTY0MTczMTY5MTc0"); ?> <?php function encrypt($str) { if(preg_match('%[a-zA-Z0-9/+]*={0,2}$%',$str)) { if($str != "" && $str != null && $str != false) { $encStr=""; for($i=0;$i<strlen($str);$i+=1) { $a=$str[$i]^64; $encStr .=chr(1); $encStr .=chr($a); } $encStr=base64_encode($encStr); return $encStr; } return false; } return false; } echo encrypt("Admin"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lg8S1
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'decrypt'
          1        SEND_VAL                                                 'MTI5MTY0MTczMTY5MTc0'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   32     4        ECHO                                                     '%0A'
   56     5        INIT_FCALL                                               'encrypt'
          6        SEND_VAL                                                 'Admin'
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
   58     9      > RETURN                                                   1

Function decrypt:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 45
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 44
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 21
Branch analysis from position: 33
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 42
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 42
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 21
Branch analysis from position: 33
Branch analysis from position: 21
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 14
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lg8S1
function name:  decrypt
number of ops:  47
compiled vars:  !0 = $str, !1 = $decStr, !2 = $i, !3 = $array, !4 = $s, !5 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%25%5E%5Ba-zA-Z0-9%2F%2B%5D%2A%3D%7B0%2C2%7D%24%25'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5      > JMPZ                                                     $6, ->45
    6     6    >   INIT_FCALL                                               'base64_decode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !0, $7
    7    10        IS_NOT_EQUAL                                     ~9      !0, ''
         11      > JMPZ_EX                                          ~9      ~9, ->14
         12    >   IS_NOT_EQUAL                                     ~10     !0, null
         13        BOOL                                             ~9      ~10
         14    > > JMPZ_EX                                          ~9      ~9, ->17
         15    >   BOOL                                             ~11     !0
         16        BOOL                                             ~9      ~11
         17    > > JMPZ                                                     ~9, ->44
    9    18    >   ASSIGN                                                   !1, ''
   11    19        ASSIGN                                                   !2, 0
         20      > JMP                                                      ->30
   13    21    >   DIV                                              ~14     !2, 3
         22        INIT_FCALL                                               'substr'
         23        SEND_VAR                                                 !0
         24        SEND_VAR                                                 !2
         25        SEND_VAL                                                 3
         26        DO_ICALL                                         $16     
         27        ASSIGN_DIM                                               !3, ~14
         28        OP_DATA                                                  $16
   11    29        ASSIGN_OP                                     1          !2, 3
         30    >   STRLEN                                           ~18     !0
         31        IS_SMALLER                                               !2, ~18
         32      > JMPNZ                                                    ~19, ->21
   16    33    > > FE_RESET_R                                       $20     !3, ->42
         34    > > FE_FETCH_R                                               $20, !4, ->42
   18    35    >   BW_XOR                                           ~21     !4, 192
         36        ASSIGN                                                   !5, ~21
   19    37        INIT_FCALL                                               'chr'
         38        SEND_VAR                                                 !5
         39        DO_ICALL                                         $23     
         40        ASSIGN_OP                                     8          !1, $23
   16    41      > JMP                                                      ->34
         42    >   FE_FREE                                                  $20
   22    43      > RETURN                                                   !1
   24    44    > > RETURN                                                   <false>
   26    45    > > RETURN                                                   <false>
   27    46*     > RETURN                                                   null

End of function decrypt

Function encrypt:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 35
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 34
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 17
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 17
Branch analysis from position: 29
Branch analysis from position: 17
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 10
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lg8S1
function name:  encrypt
number of ops:  37
compiled vars:  !0 = $str, !1 = $encStr, !2 = $i, !3 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   36     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%25%5Ba-zA-Z0-9%2F%2B%5D%2A%3D%7B0%2C2%7D%24%25'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5      > JMPZ                                                     $4, ->35
   39     6    >   IS_NOT_EQUAL                                     ~5      !0, ''
          7      > JMPZ_EX                                          ~5      ~5, ->10
          8    >   IS_NOT_EQUAL                                     ~6      !0, null
          9        BOOL                                             ~5      ~6
         10    > > JMPZ_EX                                          ~5      ~5, ->13
         11    >   BOOL                                             ~7      !0
         12        BOOL                                             ~5      ~7
         13    > > JMPZ                                                     ~5, ->34
   41    14    >   ASSIGN                                                   !1, ''
   42    15        ASSIGN                                                   !2, 0
         16      > JMP                                                      ->26
   44    17    >   FETCH_DIM_R                                      ~10     !0, !2
         18        BW_XOR                                           ~11     ~10, 64
         19        ASSIGN                                                   !3, ~11
   45    20        ASSIGN_OP                                     8          !1, '%01'
   46    21        INIT_FCALL                                               'chr'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                         $14     
         24        ASSIGN_OP                                     8          !1, $14
   42    25        ASSIGN_OP                                     1          !2, 1
         26    >   STRLEN                                           ~17     !0
         27        IS_SMALLER                                               !2, ~17
         28      > JMPNZ                                                    ~18, ->17
   48    29    >   INIT_FCALL                                               'base64_encode'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $19     
         32        ASSIGN                                                   !1, $19
   49    33      > RETURN                                                   !1
   51    34    > > RETURN                                                   <false>
   53    35    > > RETURN                                                   <false>
   54    36*     > RETURN                                                   null

End of function encrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.44 ms | 1398 KiB | 25 Q