HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecrypton-1.0.4Haskell2010

Crypto.Cipher.RC4

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.

  • 1 type
  • 3 values
  • Packagecrypton-1.0.4
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceRC4.hs
valueinitialize
  1. :: ByteArrayAccess key
  2. => key

    The key

  3. -> State

    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.

valuecombine
  1. :: ByteArray ba
  2. => State

    rc4 context

  3. -> ba

    input

  4. -> (State, ba)

    new rc4 context, and the output

#

RC4 xor combination of the rc4 stream with an input

newtypenewtype State
#

The encryption state for RC4

This type is an instance of ByteArrayAccess for debugging purpose. Internal layout is architecture dependent, may contain uninitialized data fragments, and change in future versions. The bytearray should not be used as input to cryptographic algorithms.

Instances2NFData, ByteArrayAccess