3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * PHP mcrypt - Basic encryption and decryption of a string */ $string = "Some text to be encrypted"; $secret_key = "This is my secret key"; // Create the initialization vector for added security. $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); // Encrypt $string $encrypted_string = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $secret_key, $string, MCRYPT_MODE_CBC, $iv); // Decrypt $string $decrypted_string = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $secret_key, $encrypted_string, MCRYPT_MODE_CBC, $iv); echo "Original string : " . $string . "<br />\n"; echo "Encrypted string : " . $encrypted_string . "<br />\n"; echo "Decrypted string : " . $decrypted_string . "<br />\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/caCEc
function name:  (null)
number of ops:  44
compiled vars:  !0 = $string, !1 = $secret_key, !2 = $iv, !3 = $encrypted_string, !4 = $decrypted_string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'Some+text+to+be+encrypted'
    6     1        ASSIGN                                                   !1, 'This+is+my+secret+key'
    9     2        INIT_FCALL_BY_NAME                                       'mcrypt_create_iv'
          3        INIT_FCALL_BY_NAME                                       'mcrypt_get_iv_size'
          4        FETCH_CONSTANT                                   ~7      'MCRYPT_RIJNDAEL_256'
          5        SEND_VAL_EX                                              ~7
          6        FETCH_CONSTANT                                   ~8      'MCRYPT_MODE_ECB'
          7        SEND_VAL_EX                                              ~8
          8        DO_FCALL                                      0  $9      
          9        SEND_VAR_NO_REF_EX                                       $9
         10        FETCH_CONSTANT                                   ~10     'MCRYPT_RAND'
         11        SEND_VAL_EX                                              ~10
         12        DO_FCALL                                      0  $11     
         13        ASSIGN                                                   !2, $11
   12    14        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
         15        FETCH_CONSTANT                                   ~13     'MCRYPT_RIJNDAEL_256'
         16        SEND_VAL_EX                                              ~13
         17        SEND_VAR_EX                                              !1
         18        SEND_VAR_EX                                              !0
         19        FETCH_CONSTANT                                   ~14     'MCRYPT_MODE_CBC'
         20        SEND_VAL_EX                                              ~14
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0  $15     
         23        ASSIGN                                                   !3, $15
   15    24        INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
         25        FETCH_CONSTANT                                   ~17     'MCRYPT_RIJNDAEL_256'
         26        SEND_VAL_EX                                              ~17
         27        SEND_VAR_EX                                              !1
         28        SEND_VAR_EX                                              !3
         29        FETCH_CONSTANT                                   ~18     'MCRYPT_MODE_CBC'
         30        SEND_VAL_EX                                              ~18
         31        SEND_VAR_EX                                              !2
         32        DO_FCALL                                      0  $19     
         33        ASSIGN                                                   !4, $19
   17    34        CONCAT                                           ~21     'Original+string+%3A+', !0
         35        CONCAT                                           ~22     ~21, '%3Cbr+%2F%3E%0A'
         36        ECHO                                                     ~22
   18    37        CONCAT                                           ~23     'Encrypted+string+%3A+', !3
         38        CONCAT                                           ~24     ~23, '%3Cbr+%2F%3E%0A'
         39        ECHO                                                     ~24
   19    40        CONCAT                                           ~25     'Decrypted+string+%3A+', !4
         41        CONCAT                                           ~26     ~25, '%3Cbr+%2F%3E%0A'
         42        ECHO                                                     ~26
   20    43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.86 ms | 1399 KiB | 13 Q