qnap-decrypt-0.3.1: Decrypt files encrypted by QNAP's Hybrid Backup Sync

Safe HaskellNone
LanguageHaskell2010

Crypto.QNAP

Contents

Description

This is the heart of the qnap-decrypt package. It provides the function to decrypt the files encryped by QNAP's Hybrid Backup Sync.

Synopsis

Decrypt

decrypt Source #

Arguments

:: String

The password

-> FilePath

The source file

-> FilePath

The target file

-> IO (Maybe DecryptError)

Returns an error or Nothing in case of a success

Decrypt a QNAP encoded file (does not throw an exception)

Since 0.3.0

Errors

data DecryptError Source #

Errors the decrypter could run into

The Exception instance has a specialized displayException function which renders the error in english text (unlike show which just displays the constructor).

Since 0.3.0

Constructors

PasswordEmpty

Password is empty

InvalidKey

Invalid encryption key

UnknownFileType

Unknown file type (the file is not encrypted or it's version is not known)

BadMagic

Bad Magic (probably wrong password)

HeaderDecodeError String

Error decoding the header: <error>

PaddingError

Padding is corrupt (probably damaged file)

IOError IOException

IO Exception: <error>

ZlibError ZlibException

Decompression Exception: <error> (probably damaged file)

FileSizeMismatch

File size is different than excepted (probably damaged file)