3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $key должен быть сгенерирован заранее криптографически безопасным образом // например, с помощью openssl_random_pseudo_bytes $plaintext = "данные для шифрования"; $cipher = "aes-128-gcm"; if(function_exists('openssl_get_cipher_methods')){ if (in_array($cipher, openssl_get_cipher_methods())) { $ivlen = openssl_cipher_iv_length($cipher); $iv = openssl_random_pseudo_bytes($ivlen); $ciphertext = openssl_encrypt($plaintext, $cipher, $key, $options=0, $iv, $tag); // сохраняем $cipher, $iv и $tag для дальнейшей расшифровки $original_plaintext = openssl_decrypt($ciphertext, $cipher, $key, $options=0, $iv, $tag); echo $original_plaintext."\n"; }}else{ echo 'function openssl_get_cipher_methods IS NOT'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 44
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 43
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72eEo
function name:  (null)
number of ops:  46
compiled vars:  !0 = $plaintext, !1 = $cipher, !2 = $ivlen, !3 = $iv, !4 = $ciphertext, !5 = $key, !6 = $options, !7 = $tag, !8 = $original_plaintext
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5+%D0%B4%D0%BB%D1%8F+%D1%88%D0%B8%D1%84%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F'
    5     1        ASSIGN                                                   !1, 'aes-128-gcm'
    6     2        INIT_FCALL                                               'function_exists'
          3        SEND_VAL                                                 'openssl_get_cipher_methods'
          4        DO_ICALL                                         $11     
          5      > JMPZ                                                     $11, ->44
    7     6    >   INIT_FCALL                                               'in_array'
          7        SEND_VAR                                                 !1
          8        INIT_FCALL_BY_NAME                                       'openssl_get_cipher_methods'
          9        DO_FCALL                                      0  $12     
         10        SEND_VAR                                                 $12
         11        DO_ICALL                                         $13     
         12      > JMPZ                                                     $13, ->43
    9    13    >   INIT_FCALL_BY_NAME                                       'openssl_cipher_iv_length'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $14     
         16        ASSIGN                                                   !2, $14
   10    17        INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0  $16     
         20        ASSIGN                                                   !3, $16
   11    21        INIT_FCALL_BY_NAME                                       'openssl_encrypt'
         22        SEND_VAR_EX                                              !0
         23        SEND_VAR_EX                                              !1
         24        SEND_VAR_EX                                              !5
         25        ASSIGN                                           ~18     !6, 0
         26        SEND_VAL_EX                                              ~18
         27        SEND_VAR_EX                                              !3
         28        SEND_VAR_EX                                              !7
         29        DO_FCALL                                      0  $19     
         30        ASSIGN                                                   !4, $19
   13    31        INIT_FCALL_BY_NAME                                       'openssl_decrypt'
         32        SEND_VAR_EX                                              !4
         33        SEND_VAR_EX                                              !1
         34        SEND_VAR_EX                                              !5
         35        ASSIGN                                           ~21     !6, 0
         36        SEND_VAL_EX                                              ~21
         37        SEND_VAR_EX                                              !3
         38        SEND_VAR_EX                                              !7
         39        DO_FCALL                                      0  $22     
         40        ASSIGN                                                   !8, $22
   14    41        CONCAT                                           ~24     !8, '%0A'
         42        ECHO                                                     ~24
         43    > > JMP                                                      ->45
   16    44    >   ECHO                                                     'function+openssl_get_cipher_methods+IS+NOT'
   17    45    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.47 ms | 1392 KiB | 17 Q