3v4l.org

run code in 300+ PHP versions simultaneously
<?php // //echo password_hash("key", PASSWORD_DEFAULT); // $hash = '$2y$10$kjbEIdPANKI/MwQrdIH8.OI1K.WKrjk4.mW7OzOuCUNcddTYWNgfu'; // if(password_verify("key", $hash)=== TRUE){ // ECHO "FOUND"; // }else { // echo "NOT FOUND";} $bobKeypair = sodium_crypto_box_keypair(); $bobPublicKey = sodium_crypto_box_publickey($bobKeypair); $key = base64_encode($bobPublicKey); echo $key; // Then share $bobPublicKey with Node A # Transmission: /* Sending from Node A to Node B */ $message = "Thư mật nè Hi there"; $ciphertext = sodium_crypto_box_seal($message, base64_decode($key)); //echo base64_decode($ciphertext); /* On Node B, receiving an encrypted message from Node A */ echo $decrypted = sodium_crypto_box_seal_open($ciphertext, $bobKeypair);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OfqFq
function name:  (null)
number of ops:  28
compiled vars:  !0 = $bobKeypair, !1 = $bobPublicKey, !2 = $key, !3 = $message, !4 = $ciphertext, !5 = $decrypted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL_BY_NAME                                       'sodium_crypto_box_keypair'
          1        DO_FCALL                                      0  $6      
          2        ASSIGN                                                   !0, $6
   17     3        INIT_FCALL_BY_NAME                                       'sodium_crypto_box_publickey'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $8      
          6        ASSIGN                                                   !1, $8
   20     7        INIT_FCALL                                               'base64_encode'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !2, $10
   22    11        ECHO                                                     !2
   30    12        ASSIGN                                                   !3, 'Th%C6%B0+m%E1%BA%ADt+n%C3%A8+Hi+there'
   31    13        INIT_FCALL_BY_NAME                                       'sodium_crypto_box_seal'
         14        SEND_VAR_EX                                              !3
         15        INIT_FCALL                                               'base64_decode'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $13     
         18        SEND_VAR_NO_REF_EX                                       $13
         19        DO_FCALL                                      0  $14     
         20        ASSIGN                                                   !4, $14
   36    21        INIT_FCALL_BY_NAME                                       'sodium_crypto_box_seal_open'
         22        SEND_VAR_EX                                              !4
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0  $16     
         25        ASSIGN                                           ~17     !5, $16
         26        ECHO                                                     ~17
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
293.66 ms | 1011 KiB | 15 Q