cipher-rc4-0.1.4: Fast RC4 cipher implementation

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilitystable
PortabilityGood
Safe HaskellNone
LanguageHaskell98

Crypto.Cipher.RC4

Contents

Description

Simple implementation of the RC4 stream cipher. http://en.wikipedia.org/wiki/RC4

Initial FFI implementation by Peter White peter@janrain.com

Reorganized and simplified to have an opaque context.

Synopsis

Documentation

data RC4 #

RC4 Stream cipher

deprecated types

newtype Ctx #

The encryption context for RC4

Constructors

Ctx ByteString 

Instances

Show Ctx # 

Methods

showsPrec :: Int -> Ctx -> ShowS #

show :: Ctx -> String #

showList :: [Ctx] -> ShowS #

deprecated functions, use crypto-cipher-types StreamCipher function

initCtx #

Arguments

:: 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) #

generate the next len bytes of the rc4 stream without combining it to anything.

combine #

Arguments

:: 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) #

Deprecated: use combine instead

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

Deprecated: use combine instead