arcfour

package
v0.0.0-...-4b38b52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2019 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARC

type ARC struct {
	Rgen PRGA
	// contains filtered or unexported fields
}

ARC is the stucture that holds the vital components for a valid RC4 implementation Including a pointer to a PRGA (Psuedo Random Generation Algorithm)

func (*ARC) Decode

func (a *ARC) Decode(p_stream *bufio.Reader) []byte

func (*ARC) Encode

func (a *ARC) Encode(p_stream *bufio.Reader) []byte

func (*ARC) Init

func (a *ARC) Init(key_ []byte, iv_ ...[]byte)

Init will generate 10 high entropy bytes for the IV IV is appended to the user supplied key and the total length is stored

func (*ARC) WriteEncFile

func (a *ARC) WriteEncFile(cyphertext []byte, name string) error

type PRGA

type PRGA struct {
	S [256]byte
	// contains filtered or unexported fields
}
func (a *ARC) ReadEncFile(cyphertext []byte, name string) (byte[10], error) {
  //parses a CypherSabre file (has extension .cs1)
  //The IV removed and returned as a byte array
  //The remaining cyphertext is copied into the cyphertext buffer
}

PRGA is the Psuedo Rando Generation Algorithm it contains: two single byte indexes and a 256 byte state array

func (*PRGA) KSA

func (gen *PRGA) KSA(key [256]byte, keylen uint8)

func (*PRGA) Kstream

func (gen *PRGA) Kstream() byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL