Get api secret

@param mixed $value
@return string $value|$secret
355419
public function getSecretAttribute($value)
  {
    if ($value == null) $this->update(['secret' => $secret = (new Hashids(Hash::random(20), 15))->encode($this->id)]);
    return $value ?? $secret;
  }
472228
public function obfuscate($value)
    {
        $safe = '';

        foreach (str_split($value) as $letter) {
            if (ord($letter) > 128) {
                return $letter;
            }

            switch (rand(1, 3)) {
                case 1:
                $safe .= '&#'.ord($letter).';';
                break;
                case 2:
                $safe .= '&#x'.dechex(ord($letter)).';';
                break;
                case 3:
                $safe .= $letter;
            }
        }

        return $safe;
    }
200651
public function parse_value($value) {
        if (strpos($value, '$ToolConsumerProfile.url') !== false) {
            $value = str_replace('$ToolConsumerProfile.url', $this->get_endpoint(), $value);
        }
        return $value;

    }
1136881
protected static function getParametersInValue($value)
    {
        $parameters = [];
        $regex = '/'.self::PARAM_MARKER.'(.*?)'.self::PARAM_MARKER.'/';
        $value = is_array($value) ? $value : [$value];

        foreach ($value as $attrValue) {
            if (is_string($attrValue) && preg_match_all($regex, $attrValue, $matches) && isset($matches[1])) {
                $parameters = array_merge($parameters, $matches[1]);
            }
        }

        return $parameters;
    }
965184
public function get($name, $value = '')
    {
        if ($this->has($name)) {
            if($this->app->config('session.encryption')) {
                return $_SESSION[$name] ? $this->encrypter->decrypt($_SESSION[$name]) : $value;
            } else {
                return $_SESSION[$name] ? $_SESSION[$name] : $value;
            }
        }

        if (!empty($value)) {
            return $value;
        }

        return null;
    }
558178
private function detectFromPHPInfo($value)
    {
        $result = null;
        if (is_string($value) && preg_match('/\bApache\/(\d+(\.\d+)+)/i', $value, $m)) {
            $result = $m[1];
        }

        return $result;
    }
752236
public static function getHost($value)
    {
        if (preg_match(self::REGEXP_TCP, $value, $matches)) {
            return preg_replace("/^http:/", "tcp:", $matches[2]);
        }

        if (preg_match(self::REGEXP_SSL, $value, $matches)) {
            return preg_replace("/^https:/", "ssl:", $matches[2]);
        }

        return null;
    }
1113228
public static function parseData($value)
	{
		$ciphertext = base64_decode($value);

		// Get the IV
		$ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
		$iv     = substr($ciphertext, 0, $ivSize);

		// Get just the cipher without the IV
		$ciphertext = substr($ciphertext, $ivSize);

		// Generate key and decrypt
		$key       = md5(\App::get('config')->get('secret'));
		$plaintext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $ciphertext, MCRYPT_MODE_CBC, $iv);

		return $plaintext;
	}
454265
protected function receiveTokenFieldValueFromRequest($value = null)
    {
        $requestQueryParameter = $this->getRequest()->getQueryParams();
        $requestBody           = $this->getRequest()->getParsedBody();
        $fieldname             = $this->getFieldnameToken();

        if (true === isset($requestQueryParameter[$fieldname])) {
            $value = $requestQueryParameter[$fieldname];
        } elseif (true === isset($requestBody[$fieldname])) {
            $value = $requestBody[$fieldname];
        }

        return $value;
    }
1022110
protected function validate($value)
    {
        $v1 = $this->validator1;
        $v2 = $this->validator2;

        return $v1($value, $this->messenger) xor $v2($value, $this->messenger);
    }
650209
public function get($key, $value = null)
    {
        return $this->payloadBag->key($key, $value, true);
    }
1174969
public function encode($value)
    {
        $encryptedValue = $this->getEncryptor()->encrypt($value);
        $encodedValue = base64_encode($encryptedValue);

        return $encodedValue;
    }
1313065
public function decode($value)
    {
        if (false === array_key_exists($value, $this->values)) {
            return false;
        }

        return $this->values[$value];
    }
217888
public function decryptValue($value)
    {
        $decoded = base64_decode($value);
        $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
        $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
        $text = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->salt, $decoded, MCRYPT_MODE_ECB, $iv);

        return trim($text);
    }
757045
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')));
	}
1244945
private function getHashedCookieValue($value)
    {
        $request = \Yii::$app->getRequest();
        $validationKey = $request->cookieValidationKey;
        return \Yii::$app->getSecurity()->hashData(serialize($value), $validationKey);
    }
1256571
protected function getSaveValueSecure($value)
    {
        $newPermissions = is_array($value) ? array_map('intval', $value) : [];

        if (!empty($newPermissions)) {
            $existingPermissions = $this->model->permissions ?: [];

            $allowedPermissions = array_map(function ($permissionObject) {
                return $permissionObject->code;
            }, array_flatten($this->getFilteredPermissions()));

            foreach ($newPermissions as $permission => $code) {
                if (in_array($permission, $allowedPermissions)) {
                    $existingPermissions[$permission] = $code;
                }
            }

            $newPermissions = $existingPermissions;
        }

        return $newPermissions;
    }