3v4l.org

run code in 300+ PHP versions simultaneously
<?php $secret_key = 'denemesmdnoandowinadanw'; echo $secret_key . PHP_EOL; $message = 'Sensitive information'; $nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); $encrypted_message = sodium_crypto_secretbox($message, $nonce, $secret_key); $encrypted_message = sodium_bin2hex($encrypted_message); echo $encrypted_message . PHP_EOL; $encrypted_message = sodium_hex2bin($encrypted_message); $decrypted_message = sodium_crypto_secretbox_open($encrypted_message, $nonce, $secret_key);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/umhHi
function name:  (null)
number of ops:  32
compiled vars:  !0 = $secret_key, !1 = $message, !2 = $nonce, !3 = $encrypted_message, !4 = $decrypted_message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'denemesmdnoandowinadanw'
    5     1        CONCAT                                           ~6      !0, '%0A'
          2        ECHO                                                     ~6
    7     3        ASSIGN                                                   !1, 'Sensitive+information'
    9     4        INIT_FCALL                                               'random_bytes'
          5        FETCH_CONSTANT                                   ~8      'SODIUM_CRYPTO_SECRETBOX_NONCEBYTES'
          6        SEND_VAL                                                 ~8
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !2, $9
   10     9        INIT_FCALL_BY_NAME                                       'sodium_crypto_secretbox'
         10        SEND_VAR_EX                                              !1
         11        SEND_VAR_EX                                              !2
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0  $11     
         14        ASSIGN                                                   !3, $11
   12    15        INIT_FCALL_BY_NAME                                       'sodium_bin2hex'
         16        SEND_VAR_EX                                              !3
         17        DO_FCALL                                      0  $13     
         18        ASSIGN                                                   !3, $13
   14    19        CONCAT                                           ~15     !3, '%0A'
         20        ECHO                                                     ~15
   16    21        INIT_FCALL_BY_NAME                                       'sodium_hex2bin'
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0  $16     
         24        ASSIGN                                                   !3, $16
   18    25        INIT_FCALL_BY_NAME                                       'sodium_crypto_secretbox_open'
         26        SEND_VAR_EX                                              !3
         27        SEND_VAR_EX                                              !2
         28        SEND_VAR_EX                                              !0
         29        DO_FCALL                                      0  $18     
         30        ASSIGN                                                   !4, $18
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.58 ms | 1006 KiB | 14 Q