lithium\storage\session\strategy\Encrypt::_hashSecret PHP 메소드

_hashSecret() 보호된 메소드

This method figures out the appropriate key size for the chosen encryption algorithm and then hashes the given key accordingly. Note that if the key has already the needed length, it is considered to be hashed (secure) already and is therefore not hashed again. This lets you change the hashing method in your own code if you like. The default MCRYPT_RIJNDAEL_128 key should be 32 byte long sha256 is used as the hashing algorithm. If the key size is shorter than the one generated by sha256, the first n bytes will be used.
protected _hashSecret ( string $key ) : string
$key string The possibly too weak key.
리턴 string The hashed (raw) key.
    protected function _hashSecret($key)
    {
        $size = mcrypt_enc_get_key_size(static::$_resource);
        if (strlen($key) >= $size) {
            return $key;
        }
        return substr(hash('sha256', $key, true), 0, $size);
    }