src/Encryption/Service/CipherService.php
private function createKey(string $key = null): Key
    {
        if (null === $key) {
            $key = $this->key;
        }

        if (null === $key) {
            throw new LogicException('Cipher secret key is not defined.');
        }

        $key = Key::loadFromAsciiSafeString($key);

        return $key;
    }
private function createKey(string $key = null): Key
    {
        if (null === $key) {
            $key = $this->key;
        }

        if (null === $key) {
            throw new LogicException('Cipher secret key is not defined.');
        }

        $key = Key::loadFromAsciiSafeString($key);

        return $key;
    }
Create key

@param string $key
@return \Defuse\Crypto\Key
@throws \LogicException If the key is not defined