-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Fast AES encryption/decryption for bytestrings -- -- A simplified binding to Brian Gladman's AES implementation, including -- a copy of that implementation @package SimpleAES @version 0.4 -- | A pure interface to AES module Codec.Crypto.SimpleAES data Mode ECB :: Mode CBC :: Mode data Direction Encrypt :: Direction Decrypt :: Direction type Key = ByteString type IV = ByteString newIV :: IO IV randomKey :: IO Key -- | Encryption/decryption for lazy bytestrings. The input string is -- zero-padded to a multiple of 16. It is your obligation to separate -- encode the length of the string. -- -- 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 crypt :: Mode -> Key -> IV -> Direction -> ByteString -> ByteString -- | Encrypt a bytestring using a random seed (IV). Since the seed is -- random, this function is tainted by IO. encryptMsg :: Mode -> Key -> ByteString -> IO ByteString -- | Encrypt a ByteString using a given seed (IV). The resulting ByteString -- contains both the seed and the original length of the input (before -- padding). encryptMsg' :: Mode -> Key -> IV -> ByteString -> ByteString decryptMsg :: Mode -> Key -> ByteString -> ByteString