3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'hello'; $key = 'test'; echo bin2hex(mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, '')); echo "\n"; echo bin2hex(mcrypt_decrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, '')); $encrypted = hex2bin('c6ea4b7d8f'); echo "\n"; echo mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $encrypted, MCRYPT_MODE_STREAM, ''); echo "\n"; echo mcrypt_decrypt(MCRYPT_ARCFOUR, $key, $encrypted, MCRYPT_MODE_STREAM, ''); /* --- using OpenSSL --- */ echo "\n"; echo bin2hex(openssl_encrypt($text, 'RC4', pack('H*', $key), OPENSSL_ZERO_PADDING | OPENSSL_RAW_DATA));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oc8cm
function name:  (null)
number of ops:  74
compiled vars:  !0 = $text, !1 = $key, !2 = $encrypted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'hello'
    4     1        ASSIGN                                                   !1, 'test'
    5     2        INIT_FCALL                                               'bin2hex'
          3        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
          4        FETCH_CONSTANT                                   ~5      'MCRYPT_ARCFOUR'
          5        SEND_VAL_EX                                              ~5
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !0
          8        FETCH_CONSTANT                                   ~6      'MCRYPT_MODE_STREAM'
          9        SEND_VAL_EX                                              ~6
         10        SEND_VAL_EX                                              ''
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        DO_ICALL                                         $8      
         14        ECHO                                                     $8
    6    15        ECHO                                                     '%0A'
    7    16        INIT_FCALL                                               'bin2hex'
         17        INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
         18        FETCH_CONSTANT                                   ~9      'MCRYPT_ARCFOUR'
         19        SEND_VAL_EX                                              ~9
         20        SEND_VAR_EX                                              !1
         21        SEND_VAR_EX                                              !0
         22        FETCH_CONSTANT                                   ~10     'MCRYPT_MODE_STREAM'
         23        SEND_VAL_EX                                              ~10
         24        SEND_VAL_EX                                              ''
         25        DO_FCALL                                      0  $11     
         26        SEND_VAR                                                 $11
         27        DO_ICALL                                         $12     
         28        ECHO                                                     $12
    9    29        INIT_FCALL                                               'hex2bin'
         30        SEND_VAL                                                 'c6ea4b7d8f'
         31        DO_ICALL                                         $13     
         32        ASSIGN                                                   !2, $13
   10    33        ECHO                                                     '%0A'
   11    34        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
         35        FETCH_CONSTANT                                   ~15     'MCRYPT_ARCFOUR'
         36        SEND_VAL_EX                                              ~15
         37        SEND_VAR_EX                                              !1
         38        SEND_VAR_EX                                              !2
         39        FETCH_CONSTANT                                   ~16     'MCRYPT_MODE_STREAM'
         40        SEND_VAL_EX                                              ~16
         41        SEND_VAL_EX                                              ''
         42        DO_FCALL                                      0  $17     
         43        ECHO                                                     $17
   12    44        ECHO                                                     '%0A'
   13    45        INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
         46        FETCH_CONSTANT                                   ~18     'MCRYPT_ARCFOUR'
         47        SEND_VAL_EX                                              ~18
         48        SEND_VAR_EX                                              !1
         49        SEND_VAR_EX                                              !2
         50        FETCH_CONSTANT                                   ~19     'MCRYPT_MODE_STREAM'
         51        SEND_VAL_EX                                              ~19
         52        SEND_VAL_EX                                              ''
         53        DO_FCALL                                      0  $20     
         54        ECHO                                                     $20
   16    55        ECHO                                                     '%0A'
   17    56        INIT_FCALL                                               'bin2hex'
         57        INIT_FCALL_BY_NAME                                       'openssl_encrypt'
         58        SEND_VAR_EX                                              !0
         59        SEND_VAL_EX                                              'RC4'
         60        INIT_FCALL                                               'pack'
         61        SEND_VAL                                                 'H%2A'
         62        SEND_VAR                                                 !1
         63        DO_ICALL                                         $21     
         64        SEND_VAR_NO_REF_EX                                       $21
         65        FETCH_CONSTANT                                   ~22     'OPENSSL_ZERO_PADDING'
         66        FETCH_CONSTANT                                   ~23     'OPENSSL_RAW_DATA'
         67        BW_OR                                            ~24     ~22, ~23
         68        SEND_VAL_EX                                              ~24
         69        DO_FCALL                                      0  $25     
         70        SEND_VAR                                                 $25
         71        DO_ICALL                                         $26     
         72        ECHO                                                     $26
         73      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.3 ms | 1440 KiB | 16 Q