e-0.1.0.0: Express sensitive data inside text files in readable and compact way.

Safe HaskellNone
LanguageHaskell2010

E.Encrypt

Contents

Description

Encryption / decryption primitives over Tem and Metadata.

Synopsis

Basic encryption primitives

newtype Cipher Source #

Cipher routine.

Constructors

Cipher 

newtype Decipher Source #

Decipher routine.

Container of multiple encryption algorithms

newtype Algs Source #

Algorithms container. Mapping from AlgName to corresponde Cipher and Decipher routine.

Constructors

Algs 

Instances

Semigroup Algs Source #

Semigroup over inner map.

Methods

(<>) :: Algs -> Algs -> Algs #

sconcat :: NonEmpty Algs -> Algs #

stimes :: Integral b => b -> Algs -> Algs #

Monoid Algs Source #

Monoid over inner map.

Methods

mempty :: Algs #

mappend :: Algs -> Algs -> Algs #

mconcat :: [Algs] -> Algs #

algorithm :: AlgName -> Cipher -> Decipher -> Algs Source #

Build Algs with a single algorithm.

Operations on Tem

encryptTem :: Algs -> Metadata -> Tem -> EitherT EError IO (Tem, Metadata) Source #

Encrypt template with algorithms container and metadata.

Note: ciphered values will be left intact.

decryptTem :: Algs -> Metadata -> Tem -> EitherT EError IO Tem Source #

Decrypt template with algorithms container and metadata.

Note: if plain value occurred, DecryptingPlain will be returned.

Exceptions

data EError Source #

Exception during encrypting/decrypting the Tem.

Constructors

AlgNotFound AlgName

EAlg is not supported.

ValNotFound ValName

ValName is not defined.

DecryptingPlain ValName

Tem contains PlainValue values that cannot be decrypted.

MetadataError MetadataError

Metadata operation failed.

CipherError AlgName Text

Error during ciphering using AlgName algorithm.

DecipherError AlgName Text

Error during deciphering using AlgName algorithm.