arc4

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package arc4 provides multiple implementations of RC4-based socket encryption methods. WARNING: RC4 is widely deemed as UNSAFE by cryptography specialists. We only are providing this package for backward compatibility with existing implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARC4

type ARC4 struct {
	S []byte
	// contains filtered or unexported fields
}

func New

func New(key []byte) *ARC4

func (*ARC4) Decrypt

func (this *ARC4) Decrypt(data []byte)

func (*ARC4) Encrypt

func (this *ARC4) Encrypt(data []byte)

func (*ARC4) Next

func (this *ARC4) Next() uint8

type AuthCipher

type AuthCipher struct {
	ServerEncryptionKey []byte
	ServerDecryptionKey []byte
	// contains filtered or unexported fields
}

AuthCipher creates two ARC4 states for sending and recieving. They are created from pre-generated seeds, computed along with the session key.

func (*AuthCipher) Decrypt

func (c *AuthCipher) Decrypt(data, tag []byte) error

func (*AuthCipher) Encrypt

func (c *AuthCipher) Encrypt(data, tag []byte) error

func (*AuthCipher) Init

func (c *AuthCipher) Init(server bool, sessionKey []byte) error

type CipherTBC

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

CipherTBC implements Vanilla encryption but with an HMAC key.

func (*CipherTBC) Decrypt

func (v *CipherTBC) Decrypt(data, tag []byte) error

func (*CipherTBC) Encrypt

func (v *CipherTBC) Encrypt(data, tag []byte) error

func (*CipherTBC) Init

func (v *CipherTBC) Init(server bool, sessionKey []byte) error

type CipherVanilla

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

CipherVanilla implements Vanilla-style encryption (Not ARC4, what even is this?) some kind of basic xor counter cipher

func (*CipherVanilla) Decrypt

func (v *CipherVanilla) Decrypt(data, tag []byte) error

func (*CipherVanilla) Encrypt

func (v *CipherVanilla) Encrypt(data, tag []byte) error

func (*CipherVanilla) Init

func (v *CipherVanilla) Init(server bool, sessionKey []byte) error

Jump to

Keyboard shortcuts

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