haskell-tor-0.1.1: A Haskell Tor Node

Safe HaskellNone
LanguageHaskell2010

Tor.HybridCrypto

Description

Tor defines a form of hybrid crypto, in which data is either just encrypted with a public key, or, encrypted using a hybrid of RSA and AES. This module implements this technique.

Synopsis

Documentation

hybridEncrypt :: MonadRandom m => Bool -> PublicKey -> ByteString -> m ByteString Source

Encrypt a piece of data using the given public key, optionally forcing the routine to use hybrid encryption even if the size of the data doesn't warrant it.

hybridDecrypt :: MonadRandom m => PrivateKey -> ByteString -> m ByteString Source

Decrypt a piece of data using the given private key.