- type Key = ByteString
- getKey :: FilePath -> IO Key
- defaultKeyFile :: String
- getDefaultKey :: IO Key
- encrypt :: ByteString -> ByteString -> ByteString
- decrypt :: ByteString -> ByteString -> Maybe ByteString
Automatic key generation
type Key = ByteStringSource
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
:: ByteString | key |
-> ByteString | data |
-> ByteString |
:: ByteString | key |
-> ByteString | data |
-> Maybe ByteString |