Portability | Good |
---|---|
Stability | stable |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Safe Haskell | None |
Initial FFI implementation by Peter White peter@janrain.com
Reorganized and simplified to have an opaque context.
- newtype Ctx = Ctx ByteString
- initCtx :: ByteString -> Ctx
- generate :: Ctx -> Int -> (Ctx, ByteString)
- combine :: Ctx -> ByteString -> (Ctx, ByteString)
- encrypt :: Ctx -> ByteString -> (Ctx, ByteString)
- decrypt :: Ctx -> ByteString -> (Ctx, ByteString)
Documentation
:: ByteString | The key |
-> Ctx | The RC4 context with the key mixed in |
RC4 context initialization.
seed the context with an initial key. the key size need to be adequate otherwise security takes a hit.
generate :: Ctx -> Int -> (Ctx, ByteString)Source
generate the next len bytes of the rc4 stream without combining it to anything.
:: Ctx | rc4 context |
-> ByteString | input |
-> (Ctx, ByteString) | new rc4 context, and the output |
RC4 xor combination of the rc4 stream with an input
encrypt :: Ctx -> ByteString -> (Ctx, ByteString)Source
Deprecated: use combine instead
decrypt :: Ctx -> ByteString -> (Ctx, ByteString)Source
Deprecated: use combine instead