SimpleAES-0.2: Fast AES encryption/decryption for bytestringsSource codeContentsIndex
Codec.Crypto.SimpleAES
Description
A pure interface to AES
Synopsis
data Mode
= ECB
| CBC
data Direction
= Encrypt
| Decrypt
type Key = ByteString
type IV = ByteString
newIV :: IO IV
randomKey :: IO Key
crypt :: Mode -> Key -> IV -> Direction -> ByteString -> ByteString
Documentation
data Mode Source
Modes ECB and CBC can only handle full 16-byte frames. This means the length of every strict bytestring passed in must be a multiple of 16; when using lazy bytestrings, its component strict bytestrings must all satisfy this.
Constructors
ECB
CBC
data Direction Source
Constructors
Encrypt
Decrypt
type Key = ByteStringSource
type IV = ByteStringSource
newIV :: IO IVSource
randomKey :: IO KeySource
cryptSource
:: Mode
-> KeyThe AES key - 16, 24 or 32 bytes
-> IV
-> Direction
-> ByteStringBytestring to encrypt/decrypt
-> ByteString
Encryption/decryption for lazy bytestrings Properties: x == y => crypt mode key iv dir x == crypt mode key iv dir y take (length x) (crypt mode key iv Decrypt (crypt mode key iv Encrypt x)) == x
Produced by Haddock version 2.6.0