rc4

Imports

Imports #

"crypto/internal/fips140/alias"
"crypto/internal/fips140only"
"errors"
"strconv"

Type Aliases

KeySizeError type #

type KeySizeError int

Structs

Cipher struct #

A Cipher is an instance of RC4 using a particular key.

type Cipher struct {
s [256]uint32
i uint8
j uint8
}

Functions

Error method #

func (k KeySizeError) Error() string

NewCipher function #

NewCipher creates and returns a new [Cipher]. The key argument should be the RC4 key, at least 1 byte and at most 256 bytes.

func NewCipher(key []byte) (*Cipher, error)

Reset method #

Reset zeros the key data and makes the [Cipher] unusable. Deprecated: Reset can't guarantee that the key will be entirely removed from the process's memory.

func (c *Cipher) Reset()

XORKeyStream method #

XORKeyStream sets dst to the result of XORing src with the key stream. Dst and src must overlap entirely or not at all.

func (c *Cipher) XORKeyStream(dst []byte, src []byte)

Generated with Arrow