protected function encrypt($unencryptedData)
    {
        try {
            if ($this->encryptionKey instanceof Key) {
                return Crypto::encrypt($unencryptedData, $this->encryptionKey);
            }

            return Crypto::encryptWithPassword($unencryptedData, $this->encryptionKey);
        } catch (Exception $e) {
            throw new LogicException($e->getMessage(), null, $e);
        }
    }