3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Illuminate\Encryption; use Symfony\Component\Security\Core\Util\StringUtils; use Symfony\Component\Security\Core\Util\SecureRandom; class DecryptException extends \RuntimeException {} class Encrypter { /** * The encryption key. * * @var string */ protected $key; /** * The algorithm used for encryption. * * @var string */ protected $cipher = 'rijndael-256'; /** * The mode used for encryption. * * @var string */ protected $mode = 'cbc'; /** * The block size of the cipher. * * @var int */ protected $block = 32; /** * Create a new encrypter instance. * * @param string $key * @return void */ public function __construct($key) { $this->key = $key; } /** * Encrypt the given value. * * @param string $value * @return string */ public function encrypt($value) { $iv = mcrypt_create_iv($this->getIvSize(), $this->getRandomizer()); $value = base64_encode($this->padAndMcrypt($value, $iv)); // Once we have the encrypted value we will go ahead base64_encode the input // vector and create the MAC for the encrypted value so we can verify its // authenticity. Then, we'll JSON encode the data in a "payload" array. $mac = $this->hash($iv = base64_encode($iv), $value); return base64_encode(json_encode(compact('iv', 'value', 'mac'))); } /** * Pad and use mcrypt on the given value and input vector. * * @param string $value * @param string $iv * @return string */ protected function padAndMcrypt($value, $iv) { $value = $this->addPadding(serialize($value)); return mcrypt_encrypt($this->cipher, $this->key, $value, $this->mode, $iv); } /** * Decrypt the given value. * * @param string $payload * @return string */ public function decrypt($payload) { $payload = $this->getJsonPayload($payload); // We'll go ahead and remove the PKCS7 padding from the encrypted value before // we decrypt it. Once we have the de-padded value, we will grab the vector // and decrypt the data, passing back the unserialized from of the value. $value = base64_decode($payload['value']); $iv = base64_decode($payload['iv']); return unserialize($this->stripPadding($this->mcryptDecrypt($value, $iv))); } /** * Run the mcrypt decryption routine for the value. * * @param string $value * @param string $iv * @return string */ protected function mcryptDecrypt($value, $iv) { return mcrypt_decrypt($this->cipher, $this->key, $value, $this->mode, $iv); } /** * Get the JSON array from the given payload. * * @param string $payload * @return array * * @throws DecryptException */ protected function getJsonPayload($payload) { $payload = json_decode(base64_decode($payload), true); // If the payload is not valid JSON or does not have the proper keys set we will // assume it is invalid and bail out of the routine since we will not be able // to decrypt the given value. We'll also check the MAC for this encryption. if ( ! $payload || $this->invalidPayload($payload)) { throw new DecryptException("Invalid data."); } if ( ! $this->validMac($payload)) { throw new DecryptException("MAC is invalid."); } return $payload; } /** * Determine if the MAC for the given payload is valid. * * @param array $payload * @return bool */ protected function validMac(array $payload) { $bytes = with(new SecureRandom)->nextBytes(16); $calcMac = hash_hmac('sha256', $this->hash($payload['iv'], $payload['value']), $bytes, true); return StringUtils::equals(hash_hmac('sha256', $payload['mac'], $bytes, true), $calcMac); } /** * Create a MAC for the given value. * * @param string $iv * @param string $value * @return string */ protected function hash($iv, $value) { return hash_hmac('sha256', $iv.$value, $this->key); } /** * Add PKCS7 padding to a given value. * * @param string $value * @return string */ protected function addPadding($value) { $pad = $this->block - (strlen($value) % $this->block); return $value.str_repeat(chr($pad), $pad); } /** * Remove the padding from the given value. * * @param string $value * @return string */ protected function stripPadding($value) { $pad = ord($value[($len = strlen($value)) - 1]); return $this->paddingIsValid($pad, $value) ? substr($value, 0, $len - $pad) : $value; } /** * Determine if the given padding for a value is valid. * * @param string $pad * @param string $value * @return bool */ protected function paddingIsValid($pad, $value) { $beforePad = strlen($value) - $pad; return substr($value, $beforePad) == str_repeat(substr($value, -1), $pad); } /** * Verify that the encryption payload is valid. * * @param array|mixed $data * @return bool */ protected function invalidPayload($data) { return ! is_array($data) || ! isset($data['iv']) || ! isset($data['value']) || ! isset($data['mac']); } /** * Get the IV size for the cipher. * * @return int */ protected function getIvSize() { return mcrypt_get_iv_size($this->cipher, $this->mode); } /** * Get the random data source available for the OS. * * @return int */ protected function getRandomizer() { if (defined('MCRYPT_DEV_URANDOM')) return MCRYPT_DEV_URANDOM; if (defined('MCRYPT_DEV_RANDOM')) return MCRYPT_DEV_RANDOM; mt_srand(); return MCRYPT_RAND; } /** * Set the encryption key. * * @param string $key * @return void */ public function setKey($key) { $this->key = $key; } /** * Set the encryption cipher. * * @param string $cipher * @return void */ public function setCipher($cipher) { $this->cipher = $cipher; } /** * Set the encryption mode. * * @param string $mode * @return void */ public function setMode($mode) { $this->mode = $mode; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  280     0  E > > RETURN                                                   1

Class Illuminate\Encryption\DecryptException: [no user functions]
Class Illuminate\Encryption\Encrypter:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  __construct
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
   46     1        ASSIGN_OBJ                                               'key'
          2        OP_DATA                                                  !0
   47     3      > RETURN                                                   null

End of function __construct

Function encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  encrypt
number of ops:  40
compiled vars:  !0 = $value, !1 = $iv, !2 = $mac
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   57     1        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cmcrypt_create_iv'
          2        INIT_METHOD_CALL                                         'getIvSize'
          3        DO_FCALL                                      0  $3      
          4        SEND_VAR_NO_REF_EX                                       $3
          5        INIT_METHOD_CALL                                         'getRandomizer'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !1, $5
   59    10        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cbase64_encode'
         11        INIT_METHOD_CALL                                         'padAndMcrypt'
         12        SEND_VAR_EX                                              !0
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $7      
         15        SEND_VAR_NO_REF_EX                                       $7
         16        DO_FCALL                                      0  $8      
         17        ASSIGN                                                   !0, $8
   64    18        INIT_METHOD_CALL                                         'hash'
         19        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cbase64_encode'
         20        SEND_VAR_EX                                              !1
         21        DO_FCALL                                      0  $10     
         22        ASSIGN                                           ~11     !1, $10
         23        SEND_VAL_EX                                              ~11
         24        SEND_VAR_EX                                              !0
         25        DO_FCALL                                      0  $12     
         26        ASSIGN                                                   !2, $12
   66    27        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cbase64_encode'
         28        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cjson_encode'
         29        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Ccompact'
         30        SEND_VAL_EX                                              'iv'
         31        SEND_VAL_EX                                              'value'
         32        SEND_VAL_EX                                              'mac'
         33        DO_FCALL                                      0  $14     
         34        SEND_VAR_NO_REF_EX                                       $14
         35        DO_FCALL                                      0  $15     
         36        SEND_VAR_NO_REF_EX                                       $15
         37        DO_FCALL                                      0  $16     
         38      > RETURN                                                   $16
   67    39*     > RETURN                                                   null

End of function encrypt

Function padandmcrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  padAndMcrypt
number of ops:  24
compiled vars:  !0 = $value, !1 = $iv
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   78     2        INIT_METHOD_CALL                                         'addPadding'
          3        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cserialize'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR_NO_REF_EX                                       $2
          7        DO_FCALL                                      0  $3      
          8        ASSIGN                                                   !0, $3
   80     9        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cmcrypt_encrypt'
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $5      'cipher'
         12        SEND_FUNC_ARG                                            $5
         13        CHECK_FUNC_ARG                                           
         14        FETCH_OBJ_FUNC_ARG                               $6      'key'
         15        SEND_FUNC_ARG                                            $6
         16        SEND_VAR_EX                                              !0
         17        CHECK_FUNC_ARG                                           
         18        FETCH_OBJ_FUNC_ARG                               $7      'mode'
         19        SEND_FUNC_ARG                                            $7
         20        SEND_VAR_EX                                              !1
         21        DO_FCALL                                      0  $8      
         22      > RETURN                                                   $8
   81    23*     > RETURN                                                   null

End of function padandmcrypt

Function decrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  decrypt
number of ops:  29
compiled vars:  !0 = $payload, !1 = $value, !2 = $iv
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   89     0  E >   RECV                                             !0      
   91     1        INIT_METHOD_CALL                                         'getJsonPayload'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   96     5        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cbase64_decode'
          6        CHECK_FUNC_ARG                                           
          7        FETCH_DIM_FUNC_ARG                               $5      !0, 'value'
          8        SEND_FUNC_ARG                                            $5
          9        DO_FCALL                                      0  $6      
         10        ASSIGN                                                   !1, $6
   98    11        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cbase64_decode'
         12        CHECK_FUNC_ARG                                           
         13        FETCH_DIM_FUNC_ARG                               $8      !0, 'iv'
         14        SEND_FUNC_ARG                                            $8
         15        DO_FCALL                                      0  $9      
         16        ASSIGN                                                   !2, $9
  100    17        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cunserialize'
         18        INIT_METHOD_CALL                                         'stripPadding'
         19        INIT_METHOD_CALL                                         'mcryptDecrypt'
         20        SEND_VAR_EX                                              !1
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0  $11     
         23        SEND_VAR_NO_REF_EX                                       $11
         24        DO_FCALL                                      0  $12     
         25        SEND_VAR_NO_REF_EX                                       $12
         26        DO_FCALL                                      0  $13     
         27      > RETURN                                                   $13
  101    28*     > RETURN                                                   null

End of function decrypt

Function mcryptdecrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  mcryptDecrypt
number of ops:  17
compiled vars:  !0 = $value, !1 = $iv
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  110     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  112     2        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cmcrypt_decrypt'
          3        CHECK_FUNC_ARG                                           
          4        FETCH_OBJ_FUNC_ARG                               $2      'cipher'
          5        SEND_FUNC_ARG                                            $2
          6        CHECK_FUNC_ARG                                           
          7        FETCH_OBJ_FUNC_ARG                               $3      'key'
          8        SEND_FUNC_ARG                                            $3
          9        SEND_VAR_EX                                              !0
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $4      'mode'
         12        SEND_FUNC_ARG                                            $4
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $5      
         15      > RETURN                                                   $5
  113    16*     > RETURN                                                   null

End of function mcryptdecrypt

Function getjsonpayload:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/hHBjT
function name:  getJsonPayload
number of ops:  31
compiled vars:  !0 = $payload
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  123     0  E >   RECV                                             !0      
  125     1        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cjson_decode'
          2        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cbase64_decode'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR_NO_REF_EX                                       $1
          6        SEND_VAL_EX                                              <true>
          7        DO_FCALL                                      0  $2      
          8        ASSIGN                                                   !0, $2
  130     9        BOOL_NOT                                         ~4      !0
         10      > JMPNZ_EX                                         ~4      ~4, ->15
         11    >   INIT_METHOD_CALL                                         'invalidPayload'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0  $5      
         14        BOOL                                             ~4      $5
         15    > > JMPZ                                                     ~4, ->20
  132    16    >   NEW                                              $6      'Illuminate%5CEncryption%5CDecryptException'
         17        SEND_VAL_EX                                              'Invalid+data.'
         18        DO_FCALL                                      0          
         19      > THROW                                         0          $6
  135    20    >   INIT_METHOD_CALL                                         'validMac'
         21        SEND_VAR_EX                                              !0
         22        DO_FCALL                                      0  $8      
         23        BOOL_NOT                                         ~9      $8
         24      > JMPZ                                                     ~9, ->29
  137    25    >   NEW                                              $10     'Illuminate%5CEncryption%5CDecryptException'
         26        SEND_VAL_EX                                              'MAC+is+invalid.'
         27        DO_FCALL                                      0          
         28      > THROW                                         0          $10
  140    29    > > RETURN                                                   !0
  141    30*     > RETURN                                                   null

End of function getjsonpayload

Function validmac:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  validMac
number of ops:  39
compiled vars:  !0 = $payload, !1 = $bytes, !2 = $calcMac
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  149     0  E >   RECV                                             !0      
  151     1        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cwith'
          2        NEW                                              $3      'Symfony%5CComponent%5CSecurity%5CCore%5CUtil%5CSecureRandom'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $3
          5        DO_FCALL                                      0  $5      
          6        INIT_METHOD_CALL                                         $5, 'nextBytes'
          7        SEND_VAL_EX                                              16
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !1, $6
  153    10        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Chash_hmac'
         11        SEND_VAL_EX                                              'sha256'
         12        INIT_METHOD_CALL                                         'hash'
         13        CHECK_FUNC_ARG                                           
         14        FETCH_DIM_FUNC_ARG                               $8      !0, 'iv'
         15        SEND_FUNC_ARG                                            $8
         16        CHECK_FUNC_ARG                                           
         17        FETCH_DIM_FUNC_ARG                               $9      !0, 'value'
         18        SEND_FUNC_ARG                                            $9
         19        DO_FCALL                                      0  $10     
         20        SEND_VAR_NO_REF_EX                                       $10
         21        SEND_VAR_EX                                              !1
         22        SEND_VAL_EX                                              <true>
         23        DO_FCALL                                      0  $11     
         24        ASSIGN                                                   !2, $11
  155    25        INIT_STATIC_METHOD_CALL                                  'Symfony%5CComponent%5CSecurity%5CCore%5CUtil%5CStringUtils', 'equals'
         26        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Chash_hmac'
         27        SEND_VAL_EX                                              'sha256'
         28        CHECK_FUNC_ARG                                           
         29        FETCH_DIM_FUNC_ARG                               $13     !0, 'mac'
         30        SEND_FUNC_ARG                                            $13
         31        SEND_VAR_EX                                              !1
         32        SEND_VAL_EX                                              <true>
         33        DO_FCALL                                      0  $14     
         34        SEND_VAR_NO_REF_EX                                       $14
         35        SEND_VAR_EX                                              !2
         36        DO_FCALL                                      0  $15     
         37      > RETURN                                                   $15
  156    38*     > RETURN                                                   null

End of function validmac

Function hash:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  hash
number of ops:  12
compiled vars:  !0 = $iv, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  165     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  167     2        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Chash_hmac'
          3        SEND_VAL_EX                                              'sha256'
          4        CONCAT                                           ~2      !0, !1
          5        SEND_VAL_EX                                              ~2
          6        CHECK_FUNC_ARG                                           
          7        FETCH_OBJ_FUNC_ARG                               $3      'key'
          8        SEND_FUNC_ARG                                            $3
          9        DO_FCALL                                      0  $4      
         10      > RETURN                                                   $4
  168    11*     > RETURN                                                   null

End of function hash

Function addpadding:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  addPadding
number of ops:  19
compiled vars:  !0 = $value, !1 = $pad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  176     0  E >   RECV                                             !0      
  178     1        FETCH_OBJ_R                                      ~2      'block'
          2        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cstrlen'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $3      
          5        FETCH_OBJ_R                                      ~4      'block'
          6        MOD                                              ~5      $3, ~4
          7        SUB                                              ~6      ~2, ~5
          8        ASSIGN                                                   !1, ~6
  180     9        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cstr_repeat'
         10        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cchr'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR_NO_REF_EX                                       $8
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $9      
         16        CONCAT                                           ~10     !0, $9
         17      > RETURN                                                   ~10
  181    18*     > RETURN                                                   null

End of function addpadding

Function strippadding:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  stripPadding
number of ops:  28
compiled vars:  !0 = $value, !1 = $pad, !2 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  189     0  E >   RECV                                             !0      
  191     1        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cord'
          2        CHECK_FUNC_ARG                                           
          3        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cstrlen'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                           ~4      !2, $3
          7        SUB                                              ~5      ~4, 1
          8        FETCH_DIM_FUNC_ARG                               $6      !0, ~5
          9        SEND_FUNC_ARG                                            $6
         10        DO_FCALL                                      0  $7      
         11        ASSIGN                                                   !1, $7
  193    12        INIT_METHOD_CALL                                         'paddingIsValid'
         13        SEND_VAR_EX                                              !1
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0  $9      
         16      > JMPZ                                                     $9, ->25
         17    >   INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Csubstr'
         18        SEND_VAR_EX                                              !0
         19        SEND_VAL_EX                                              0
         20        SUB                                              ~10     !2, !1
         21        SEND_VAL_EX                                              ~10
         22        DO_FCALL                                      0  $11     
         23        QM_ASSIGN                                        ~12     $11
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~12     !0
         26    > > RETURN                                                   ~12
  194    27*     > RETURN                                                   null

End of function strippadding

Function paddingisvalid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  paddingIsValid
number of ops:  22
compiled vars:  !0 = $pad, !1 = $value, !2 = $beforePad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  203     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  205     2        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cstrlen'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0  $3      
          5        SUB                                              ~4      $3, !0
          6        ASSIGN                                                   !2, ~4
  207     7        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Csubstr'
          8        SEND_VAR_EX                                              !1
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0  $6      
         11        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cstr_repeat'
         12        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Csubstr'
         13        SEND_VAR_EX                                              !1
         14        SEND_VAL_EX                                              -1
         15        DO_FCALL                                      0  $7      
         16        SEND_VAR_NO_REF_EX                                       $7
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0  $8      
         19        IS_EQUAL                                         ~9      $6, $8
         20      > RETURN                                                   ~9
  208    21*     > RETURN                                                   null

End of function paddingisvalid

Function invalidpayload:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 13
Branch analysis from position: 9
filename:       /in/hHBjT
function name:  invalidPayload
number of ops:  19
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  216     0  E >   RECV                                             !0      
  218     1        INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cis_array'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4        BOOL_NOT                                         ~2      $1
          5      > JMPNZ_EX                                         ~2      ~2, ->9
          6    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !0, 'iv'
          7        BOOL_NOT                                         ~4      ~3
          8        BOOL                                             ~2      ~4
          9    > > JMPNZ_EX                                         ~2      ~2, ->13
         10    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~5      !0, 'value'
         11        BOOL_NOT                                         ~6      ~5
         12        BOOL                                             ~2      ~6
         13    > > JMPNZ_EX                                         ~2      ~2, ->17
         14    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~7      !0, 'mac'
         15        BOOL_NOT                                         ~8      ~7
         16        BOOL                                             ~2      ~8
         17    > > RETURN                                                   ~2
  219    18*     > RETURN                                                   null

End of function invalidpayload

Function getivsize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  getIvSize
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  228     0  E >   INIT_NS_FCALL_BY_NAME                                    'Illuminate%5CEncryption%5Cmcrypt_get_iv_size'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $0      'cipher'
          3        SEND_FUNC_ARG                                            $0
          4        CHECK_FUNC_ARG                                           
          5        FETCH_OBJ_FUNC_ARG                               $1      'mode'
          6        SEND_FUNC_ARG                                            $1
          7        DO_FCALL                                      0  $2      
          8      > RETURN                                                   $2
  229     9*     > RETURN                                                   null

End of function getivsize

Function getrandomizer:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHBjT
function name:  getRandomizer
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.66 ms | 1431 KiB | 49 Q