Safe Haskell | None |
---|---|
Language | Haskell98 |
An interface to symmetric cipher algorithms.
- data Cipher
- getCipherByName :: String -> IO (Maybe Cipher)
- getCipherNames :: IO [String]
- data CryptoMode
- cipher :: Cipher -> String -> String -> CryptoMode -> String -> IO String
- cipherBS :: Cipher -> ByteString -> ByteString -> CryptoMode -> ByteString -> IO ByteString
- cipherLBS :: Cipher -> ByteString -> ByteString -> CryptoMode -> ByteString -> IO ByteString
- cipherStrictLBS :: Cipher -> ByteString -> ByteString -> CryptoMode -> ByteString -> IO ByteString
Documentation
getCipherByName :: String -> IO (Maybe Cipher) Source
returns a symmetric cipher algorithm
whose name is getCipherByName
namename
. If no algorithms are found, the result is
Nothing
.
getCipherNames :: IO [String] Source
returns a list of name of symmetric cipher
algorithms.getCipherNames
:: Cipher | algorithm to use |
-> String | symmetric key |
-> String | IV |
-> CryptoMode | operation |
-> String | An input string to encrypt/decrypt. Note that the string must not contain any letters which aren't in the range of U+0000 - U+00FF. |
-> IO String | the result string |
Deprecated: Use cipherBS, cipherLBS or cipherStrictLBS.
lazilly encrypts or decrypts a stream of data. The
input string doesn't necessarily have to be finite.cipher
:: Cipher | algorithm to use |
-> ByteString | symmetric key |
-> ByteString | IV |
-> CryptoMode | operation |
-> ByteString | input string to encrypt/decrypt |
-> IO ByteString | the result string |
strictly encrypts or decrypts a chunk of data.cipherBS
:: Cipher | algorithm to use |
-> ByteString | symmetric key |
-> ByteString | IV |
-> CryptoMode | operation |
-> ByteString | input string to encrypt/decrypt |
-> IO ByteString | the result string |
lazilly encrypts or decrypts a stream of data. The
input string doesn't necessarily have to be finite.cipherLBS
:: Cipher | Cipher |
-> ByteString | Key |
-> ByteString | IV |
-> CryptoMode | Encrypt/Decrypt |
-> ByteString | Input |
-> IO ByteString |
Encrypt a lazy bytestring in a strict manner. Does not leak the keys.