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 = 'adfa23rsdf'; // 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/U5Ati
function name:  (null)
number of ops:  33
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        ASSIGN                                                   !2, 'adfa23rsdf'
   12     3        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
          4        FETCH_CONSTANT                                   ~8      'MCRYPT_RIJNDAEL_256'
          5        SEND_VAL_EX                                              ~8
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !0
          8        FETCH_CONSTANT                                   ~9      'MCRYPT_MODE_CBC'
          9        SEND_VAL_EX                                              ~9
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0  $10     
         12        ASSIGN                                                   !3, $10
   15    13        INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
         14        FETCH_CONSTANT                                   ~12     'MCRYPT_RIJNDAEL_256'
         15        SEND_VAL_EX                                              ~12
         16        SEND_VAR_EX                                              !1
         17        SEND_VAR_EX                                              !3
         18        FETCH_CONSTANT                                   ~13     'MCRYPT_MODE_CBC'
         19        SEND_VAL_EX                                              ~13
         20        SEND_VAR_EX                                              !2
         21        DO_FCALL                                      0  $14     
         22        ASSIGN                                                   !4, $14
   17    23        CONCAT                                           ~16     'Original+string+%3A+', !0
         24        CONCAT                                           ~17     ~16, '%3Cbr+%2F%3E%0A'
         25        ECHO                                                     ~17
   18    26        CONCAT                                           ~18     'Encrypted+string+%3A+', !3
         27        CONCAT                                           ~19     ~18, '%3Cbr+%2F%3E%0A'
         28        ECHO                                                     ~19
   19    29        CONCAT                                           ~20     'Decrypted+string+%3A+', !4
         30        CONCAT                                           ~21     ~20, '%3Cbr+%2F%3E%0A'
         31        ECHO                                                     ~21
   20    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.89 ms | 1399 KiB | 13 Q