3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Clear = "Klartext"; for ($i=50; $i < 500; $i += 50) { $crypted = fnEncrypt($Clear, str_repeat('a', $i)); echo "Encrypred: ".$crypted."</br>"; $newClear = fnDecrypt($crypted, str_repeat('a', $i)); echo "Decrypred: ".$newClear."</br>"; } function fnEncrypt($sValue, $sSecretKey) { return rtrim( base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, $sSecretKey, $sValue, MCRYPT_MODE_ECB, mcrypt_create_iv( mcrypt_get_iv_size( MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB ), MCRYPT_RAND) ) ), "\0" ); } function fnDecrypt($sValue, $sSecretKey) { return rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_256, $sSecretKey, base64_decode($sValue), MCRYPT_MODE_ECB, mcrypt_create_iv( mcrypt_get_iv_size( MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB ), MCRYPT_RAND ) ), "\0" ); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 3
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 3
Branch analysis from position: 30
Branch analysis from position: 3
filename:       /in/hLO2l
function name:  (null)
number of ops:  31
compiled vars:  !0 = $Clear, !1 = $i, !2 = $crypted, !3 = $newClear
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Klartext'
    4     1        ASSIGN                                                   !1, 50
          2      > JMP                                                      ->28
    5     3    >   INIT_FCALL_BY_NAME                                       'fnEncrypt'
          4        SEND_VAR_EX                                              !0
          5        INIT_FCALL                                               'str_repeat'
          6        SEND_VAL                                                 'a'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $6      
          9        SEND_VAR_NO_REF_EX                                       $6
         10        DO_FCALL                                      0  $7      
         11        ASSIGN                                                   !2, $7
    6    12        CONCAT                                           ~9      'Encrypred%3A+', !2
         13        CONCAT                                           ~10     ~9, '%3C%2Fbr%3E'
         14        ECHO                                                     ~10
    8    15        INIT_FCALL_BY_NAME                                       'fnDecrypt'
         16        SEND_VAR_EX                                              !2
         17        INIT_FCALL                                               'str_repeat'
         18        SEND_VAL                                                 'a'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $11     
         21        SEND_VAR_NO_REF_EX                                       $11
         22        DO_FCALL                                      0  $12     
         23        ASSIGN                                                   !3, $12
    9    24        CONCAT                                           ~14     'Decrypred%3A+', !3
         25        CONCAT                                           ~15     ~14, '%3C%2Fbr%3E'
         26        ECHO                                                     ~15
    4    27        ASSIGN_OP                                     1          !1, 50
         28    >   IS_SMALLER                                               !1, 500
         29      > JMPNZ                                                    ~17, ->3
   48    30    > > RETURN                                                   1

Function fnencrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hLO2l
function name:  fnEncrypt
number of ops:  31
compiled vars:  !0 = $sValue, !1 = $sSecretKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        INIT_FCALL                                               'rtrim'
   15     3        INIT_FCALL                                               'base64_encode'
   16     4        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
   17     5        FETCH_CONSTANT                                   ~2      'MCRYPT_RIJNDAEL_256'
          6        SEND_VAL_EX                                              ~2
          7        SEND_VAR_EX                                              !1
          8        SEND_VAR_EX                                              !0
   19     9        FETCH_CONSTANT                                   ~3      'MCRYPT_MODE_ECB'
         10        SEND_VAL_EX                                              ~3
   20    11        INIT_FCALL_BY_NAME                                       'mcrypt_create_iv'
   21    12        INIT_FCALL_BY_NAME                                       'mcrypt_get_iv_size'
   22    13        FETCH_CONSTANT                                   ~4      'MCRYPT_RIJNDAEL_256'
         14        SEND_VAL_EX                                              ~4
   23    15        FETCH_CONSTANT                                   ~5      'MCRYPT_MODE_ECB'
         16        SEND_VAL_EX                                              ~5
         17        DO_FCALL                                      0  $6      
         18        SEND_VAR_NO_REF_EX                                       $6
   25    19        FETCH_CONSTANT                                   ~7      'MCRYPT_RAND'
         20        SEND_VAL_EX                                              ~7
         21        DO_FCALL                                      0  $8      
         22        SEND_VAR_NO_REF_EX                                       $8
         23        DO_FCALL                                      0  $9      
         24        SEND_VAR                                                 $9
         25        DO_ICALL                                         $10     
         26        SEND_VAR                                                 $10
   27    27        SEND_VAL                                                 '%00'
         28        DO_ICALL                                         $11     
         29      > RETURN                                                   $11
   29    30*     > RETURN                                                   null

End of function fnencrypt

Function fndecrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hLO2l
function name:  fnDecrypt
number of ops:  31
compiled vars:  !0 = $sValue, !1 = $sSecretKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   33     2        INIT_FCALL                                               'rtrim'
   34     3        INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
   35     4        FETCH_CONSTANT                                   ~2      'MCRYPT_RIJNDAEL_256'
          5        SEND_VAL_EX                                              ~2
          6        SEND_VAR_EX                                              !1
   37     7        INIT_FCALL                                               'base64_decode'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $3      
         10        SEND_VAR_NO_REF_EX                                       $3
   38    11        FETCH_CONSTANT                                   ~4      'MCRYPT_MODE_ECB'
         12        SEND_VAL_EX                                              ~4
   39    13        INIT_FCALL_BY_NAME                                       'mcrypt_create_iv'
   40    14        INIT_FCALL_BY_NAME                                       'mcrypt_get_iv_size'
   41    15        FETCH_CONSTANT                                   ~5      'MCRYPT_RIJNDAEL_256'
         16        SEND_VAL_EX                                              ~5
   42    17        FETCH_CONSTANT                                   ~6      'MCRYPT_MODE_ECB'
         18        SEND_VAL_EX                                              ~6
         19        DO_FCALL                                      0  $7      
         20        SEND_VAR_NO_REF_EX                                       $7
   44    21        FETCH_CONSTANT                                   ~8      'MCRYPT_RAND'
         22        SEND_VAL_EX                                              ~8
         23        DO_FCALL                                      0  $9      
         24        SEND_VAR_NO_REF_EX                                       $9
         25        DO_FCALL                                      0  $10     
         26        SEND_VAR                                                 $10
   46    27        SEND_VAL                                                 '%00'
         28        DO_ICALL                                         $11     
         29      > RETURN                                                   $11
   48    30*     > RETURN                                                   null

End of function fndecrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.86 ms | 1404 KiB | 21 Q