- data Key
- data IV
- randomIV :: IO IV
- mkIV :: ByteString -> Maybe IV
- getKey :: FilePath -> IO Key
- defaultKeyFile :: String
- getDefaultKey :: IO Key
- encrypt :: Key -> IV -> ByteString -> ByteString
- encryptIO :: Key -> ByteString -> IO ByteString
- decrypt :: Key -> ByteString -> Maybe ByteString
Automatic key generation
mkIV :: ByteString -> Maybe IVSource
Get a key from the given text file.
If the file does not exist a random key will be generated and stored in that file.
defaultKeyFile :: StringSource
The default key file.
Simply calls getKey
defaultKeyFile
.
Actual encryption/decryption
:: Key | |
-> IV | |
-> ByteString | data |
-> ByteString |
encryptIO :: Key -> ByteString -> IO ByteStringSource
:: Key | key |
-> ByteString | data |
-> Maybe ByteString |