rncryptor-0.3.0.1: Haskell implementation of the RNCryptor file format

Safe HaskellNone
LanguageHaskell2010

Crypto.RNCryptor.V3.Encrypt

Synopsis

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).

encryptStream Source #

Arguments

:: Password

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.

encryptStreamWithContext Source #

Arguments

:: RNCryptorContext

The RNCryptorContext

-> InputStream ByteString

The input source (mostly likely stdin)

-> OutputStream ByteString

The output source (mostly likely stdout)

-> IO () 

Efficiently encrypt an incoming stream of bytes.