3v4l.org

run code in 300+ PHP versions simultaneously
<?php $X = encrypt("ffffff"); echo "ffffff"; echo $X; echo decrypt($X); /** * Returns an encrypted & utf8-encoded */ function encrypt($pure_string) { $encryption_key = 'random_string_here_as_private_key'; $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $encrypted_string = mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, utf8_encode($pure_string), MCRYPT_MODE_ECB, $iv); return $encrypted_string; } /** * Returns decrypted original string */ function decrypt($encrypted_string) { $encryption_key = 'random_string_here_as_private_key'; $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv); return $decrypted_string; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aionQ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $X
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'encrypt'
          1        SEND_VAL_EX                                              'ffffff'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
    5     4        ECHO                                                     'ffffff'
    7     5        ECHO                                                     !0
    9     6        INIT_FCALL_BY_NAME                                       'decrypt'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $3      
          9        ECHO                                                     $3
   30    10      > RETURN                                                   1

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

End of function encrypt

Function decrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aionQ
function name:  decrypt
number of ops:  27
compiled vars:  !0 = $encrypted_string, !1 = $encryption_key, !2 = $iv_size, !3 = $iv, !4 = $decrypted_string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        ASSIGN                                                   !1, 'random_string_here_as_private_key'
   26     2        INIT_FCALL_BY_NAME                                       'mcrypt_get_iv_size'
          3        FETCH_CONSTANT                                   ~6      'MCRYPT_BLOWFISH'
          4        SEND_VAL_EX                                              ~6
          5        FETCH_CONSTANT                                   ~7      'MCRYPT_MODE_ECB'
          6        SEND_VAL_EX                                              ~7
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
   27     9        INIT_FCALL_BY_NAME                                       'mcrypt_create_iv'
         10        SEND_VAR_EX                                              !2
         11        FETCH_CONSTANT                                   ~10     'MCRYPT_RAND'
         12        SEND_VAL_EX                                              ~10
         13        DO_FCALL                                      0  $11     
         14        ASSIGN                                                   !3, $11
   28    15        INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
         16        FETCH_CONSTANT                                   ~13     'MCRYPT_BLOWFISH'
         17        SEND_VAL_EX                                              ~13
         18        SEND_VAR_EX                                              !1
         19        SEND_VAR_EX                                              !0
         20        FETCH_CONSTANT                                   ~14     'MCRYPT_MODE_ECB'
         21        SEND_VAL_EX                                              ~14
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0  $15     
         24        ASSIGN                                                   !4, $15
   29    25      > RETURN                                                   !4
   30    26*     > RETURN                                                   null

End of function decrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.66 ms | 1400 KiB | 15 Q