Safe Haskell | None |
---|---|
Language | Haskell2010 |
- encrypt :: RNCryptorContext -> ByteString -> ByteString
- encryptBlock :: RNCryptorContext -> ByteString -> (RNCryptorContext, ByteString)
- encryptStream :: ByteString -> InputStream ByteString -> OutputStream ByteString -> IO ()
Documentation
encrypt :: RNCryptorContext -> ByteString -> ByteString Source
Encrypt a message. Please be aware that this is a user-friendly
but dangerous function, in the sense that it will load the *ENTIRE* input in
memory. It's mostly suitable for small inputs like passwords. For large
inputs, where size exceeds the available memory, please use encryptStream
.
encryptBlock :: RNCryptorContext -> ByteString -> (RNCryptorContext, ByteString) Source
Encrypt a raw Bytestring block. The function returns the encrypt text block
plus a new RNCryptorContext
, which is needed because the IV needs to be
set to the last 16 bytes of the previous cipher text. (Thanks to Rob Napier
for the insight).
:: ByteString | The user key (e.g. password) |
-> InputStream ByteString | The input source (mostly likely stdin) |
-> OutputStream ByteString | The output source (mostly likely stdout) |
-> IO () |
Efficiently encrypt an incoming stream of bytes.