|
|
|
| Description |
| This module implements RSA encryption with PKCS1 padding.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| encrypt |
| :: RandomGen g | | | => Int | Size of the modulus in bytes
| | -> PublicKey | The public key to use
| | -> g | The padding is random, so we just need this
| | -> ByteString | The string to encrypt
| | -> ByteString | | | Encrypts a ByteString using RSA with PKCS1 padding
|
|
|
| decrypt |
| :: Int | Size of the modulus in bytes
| | -> PrivateKey | The private key to use
| | -> ByteString | The string to decrypt
| | -> Maybe ByteString | | | Decrypts a ByteString using RSA with PKCS1 padding. If the ByteString
couldn't be decrypted, nothing is returned.
|
|
|
| data PublicKey |
| The public key is contained in a certificate.
| | Constructors | | PublicKey | | | publicN :: Integer | The modulus
| | publicE :: Integer | Public exponent
|
|
| Instances | |
|
|
| newtype PrivateKey |
|
|
| data PrivateKeyComplex |
| This private key variant is considerably faster.
| | Constructors | | PrivateKeyComplex | | | privateN' :: Integer | The modulus
| | privateD' :: Integer | The private exponent
| | privateP :: Integer | The first prime number
| | privateQ :: Integer | The second prime number
| | privateU :: Integer | Go read a book about it for god sake
|
|
| Instances | |
|
|
| data PrivateKeySimple |
| This private key variant takes longer to decrypt.
| | Constructors | | PrivateKeySimple | | | privateN :: Integer | The modulus
| | privateD :: Integer | Private exponent
|
|
| Instances | |
|
|
| os2ip :: (Bits a, Integral a) => ByteString -> a |
| Converts a block of bytes into a number
|
|
| i2osp :: (Bits a, Integral a) => Int -> a -> ByteString |
| Converts a number into a block of bytes
|
|
| Produced by Haddock version 0.8 |