ContentsIndex
Network.AdHoc.Encryption
MaintainerHenning Guenther
Description
Synopsis
data Encrypted a = Encrypted {
encryptedIV :: Word64
encryptedData :: ByteString
}
class Encryptable a where
encrypt :: Word64 -> Word64 -> a -> Encrypted a
decrypt :: Word64 -> Encrypted a -> Maybe a
data RSAEncrypted a = RSAEncrypted {
rsaData :: ByteString
}
class RSAEncryptable a where
rsaEncrypt :: RandomGen g => g -> Certificate -> a -> RSAEncrypted a
rsaDecrypt :: PrivateKey -> RSAEncrypted a -> Maybe a
pack64 :: [Word8] -> [Word64]
unpack64 :: [Word64] -> [Word8]
generateDESKey :: RandomGen g => g -> (Word64, g)
Documentation
data Encrypted a
Represents encrypted data.
Constructors
Encrypted
encryptedIV :: Word64
encryptedData :: ByteString
show/hide Instances
Eq (Encrypted a)
Show (Encrypted a)
class Encryptable a where
A class of types that can be encrypted with 64 bit keys and initial vectors.
Methods
encrypt
:: Word64The key to use
-> Word64The initial vector
-> aThe object to be encrypted
-> Encrypted a
Encrypts an object into an Encrypted object
decrypt
:: Word64The key to use
-> Encrypted aThe encrypted content to be decrypted
-> Maybe a
Reverses the encrypt operation
show/hide Instances
Encryptable ByteString
Encryptable String
data RSAEncrypted a
Represents data encrypted by RSA.
Constructors
RSAEncrypted
rsaData :: ByteString
show/hide Instances
Eq (RSAEncrypted a)
Show (RSAEncrypted a)
Addressed (Routed (RSAEncrypted String) sign)
class RSAEncryptable a where
A class of types that can be encrypted with RSA.
Methods
rsaEncrypt
:: RandomGen g
=> gRandom generator to generate padding
-> CertificateThe Certificate to use for encryption
-> aData to be encrypted
-> RSAEncrypted a
rsaDecrypt :: PrivateKey -> RSAEncrypted a -> Maybe a
show/hide Instances
pack64 :: [Word8] -> [Word64]
Packs a stream of 8-bit Words into a stream of 64-bit Words.
unpack64 :: [Word64] -> [Word8]
Converts a list of 64-bit words into a list of 8-bit words.
generateDESKey :: RandomGen g => g -> (Word64, g)
Randomly creates a key for DES.
Produced by Haddock version 0.8