encryption

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package encryption provides a set of encryption algorithms found in several versions of Rendez-Vous for encrypting payloads

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm interface {
	Key() []byte
	SetKey(key []byte) error
	Encrypt(payload []byte) ([]byte, error)
	Decrypt(payload []byte) ([]byte, error)
	Copy() Algorithm
}

Algorithm defines all the methods a compression algorithm should have

type Dummy

type Dummy struct {
	// contains filtered or unexported fields
}

Dummy does no encryption. Payloads are returned as-is

func NewDummyEncryption

func NewDummyEncryption() *Dummy

NewDummyEncryption returns a new instance of the Dummy encryption

func (*Dummy) Copy

func (d *Dummy) Copy() Algorithm

Copy returns a copy of the algorithm while retaining it's state

func (*Dummy) Decrypt

func (d *Dummy) Decrypt(payload []byte) ([]byte, error)

Decrypt does nothing

func (*Dummy) Encrypt

func (d *Dummy) Encrypt(payload []byte) ([]byte, error)

Encrypt does nothing

func (*Dummy) Key

func (d *Dummy) Key() []byte

Key returns the crypto key

func (*Dummy) SetKey

func (d *Dummy) SetKey(key []byte) error

SetKey sets the crypto key

type QuazalRC4

type QuazalRC4 struct {
	// contains filtered or unexported fields
}

QuazalRC4 encrypts data with RC4. Each iteration uses a new cipher instance. The key is always CD&ML

func NewQuazalRC4Encryption

func NewQuazalRC4Encryption() *QuazalRC4

NewQuazalRC4Encryption returns a new instance of the QuazalRC4 encryption

func (*QuazalRC4) Copy

func (r *QuazalRC4) Copy() Algorithm

Copy returns a copy of the algorithm while retaining it's state

func (*QuazalRC4) Decrypt

func (r *QuazalRC4) Decrypt(payload []byte) ([]byte, error)

Decrypt decrypts the payload with the incoming QuazalRC4 stream

func (*QuazalRC4) Encrypt

func (r *QuazalRC4) Encrypt(payload []byte) ([]byte, error)

Encrypt encrypts the payload with the outgoing QuazalRC4 stream

func (*QuazalRC4) Key

func (r *QuazalRC4) Key() []byte

Key returns the crypto key

func (*QuazalRC4) SetKey

func (r *QuazalRC4) SetKey(key []byte) error

SetKey sets the crypto key and updates the ciphers

type RC4

type RC4 struct {
	// contains filtered or unexported fields
}

RC4 encrypts data with RC4

func NewRC4Encryption

func NewRC4Encryption() *RC4

NewRC4Encryption returns a new instance of the RC4 encryption

func (*RC4) Copy

func (r *RC4) Copy() Algorithm

Copy returns a copy of the algorithm while retaining it's state

func (*RC4) Decrypt

func (r *RC4) Decrypt(payload []byte) ([]byte, error)

Decrypt decrypts the payload with the incoming RC4 stream

func (*RC4) Encrypt

func (r *RC4) Encrypt(payload []byte) ([]byte, error)

Encrypt encrypts the payload with the outgoing RC4 stream

func (*RC4) Key

func (r *RC4) Key() []byte

Key returns the crypto key

func (*RC4) SetKey

func (r *RC4) SetKey(key []byte) error

SetKey sets the crypto key and updates the ciphers

Jump to

Keyboard shortcuts

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