private function validateSecret(string $cipher)
    {
        if ($this->secret->getType() === SecretTypes::KEY) {
            if (\mb_strlen($this->secret->getValue(), '8bit') < $this->getKeyByteLengthForCipher($cipher)) {
                throw new EncryptionException("Key must be at least {$this->getKeyByteLengthForCipher($cipher)} bytes long");
            }
        } elseif (\mb_strlen($this->secret->getValue(), '8bit') === 0) {
            throw new EncryptionException('Password cannot be empty');
        }
    }