Crypto-3.0.3: DES, Blowfish, AES, SHA1, MD5, RSA, X.509 Identity and Attribute Certificates, General ASN.1 Support, Base64, PKCS8, PKCS1v15, Hexdump, Support for Word128, Word192 and Word256 and Beyond, PKCS5 Padding, Various Encryption Modes e.g. Cipher Block Chaining all in one package.ContentsIndex
Codec.Encryption.Modes
Portabilityportable
Stabilityexperimental
Maintainerdominic.steinitz@blueyonder.co.uk
Contents
Function types
Description
This module currently supports Cipher Block Chaining (CBC) mode. See http://www.itl.nist.gov/fipspubs/fip81.htm for further details.
Synopsis
cbc :: Bits block => (key -> block -> block) -> block -> key -> [block] -> [block]
unCbc :: Bits block => (key -> block -> block) -> block -> key -> [block] -> [block]
Function types
cbc :: Bits block => (key -> block -> block) -> block -> key -> [block] -> [block]
In CBC or Cipher Block Chaining mode each block is XORed with the previous enciphered block before encryption. For the first block, start with an initialization vector. Take an encryption function, an initialisation vector, a key and a list of blocks and return the encrypted blocks using CBC.
unCbc :: Bits block => (key -> block -> block) -> block -> key -> [block] -> [block]
To decipher in CBC or Cipher Block Chaining mode, decipher each block, then XOR the result with the previous block of plaintext result. Note that the initialization vector is treated as the zeroth block of plaintext. Take a decryption function, an initialisation vector, a key and a list of encrypted blocks using CBC and return plaintext blocks.
Produced by Haddock version 0.8