Crypto.Cipher.RC4

cryptocipher-0.2.8: Symmetrical Block, Stream and PubKey Ciphers

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | Good
Safe Haskell | None
Language | Haskell98

Crypto.Cipher.RC4

Description

Synopsis

- type Ctx = (Vector Word8, Word8, Word8)
- initCtx :: [Word8] -> Ctx
- encrypt :: Ctx -> ByteString -> (Ctx, ByteString)
- decrypt :: Ctx -> ByteString -> (Ctx, ByteString)
- encryptlazy :: Ctx -> ByteString -> (Ctx, ByteString)
- decryptlazy :: Ctx -> ByteString -> (Ctx, ByteString)

# Documentation

type Ctx = (Vector Word8, Word8, Word8)

initCtx :: [Word8] -> Ctx

initCtx initialize the Ctx with the key as parameter. the key can be of any size but not empty

encrypt :: Ctx -> ByteString -> (Ctx, ByteString)

encrypt with the current context a bytestring and returns a new context and the resulted encrypted bytestring

decrypt :: Ctx -> ByteString -> (Ctx, ByteString)

decrypt with the current context a bytestring and returns a new context and the resulted decrypted bytestring

encryptlazy :: Ctx -> ByteString -> (Ctx, ByteString)

encrypt with the current context a lazy bytestring and returns a new context and the resulted lencrypted lazy bytestring

decryptlazy :: Ctx -> ByteString -> (Ctx, ByteString)

decrypt with the current context a lazy bytestring and returns a new context and the resulted decrypted lazy bytestring