crypto

package
v0.0.0-...-382259f Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectionRSAKey = `` /* 1678-byte string literal not displayed */

Variables

This section is empty.

Functions

func Adler32

func Adler32(d uint32, p []byte) uint32

Add p to the running checksum d.

func GetConnectionRSAKey

func GetConnectionRSAKey() *rsa.PrivateKey

func RandBytes

func RandBytes(ln int) []byte

func RandUint32

func RandUint32(min, max uint32) uint32

Generate a pseudo-random integer

func ReverseBytes

func ReverseBytes(bytes []byte)

func SHA1

func SHA1(input ...[]byte) []byte

Types

type AesCipher

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

func (*AesCipher) Decrypt

func (aec *AesCipher) Decrypt(data, tag []byte) error

func (*AesCipher) Encrypt

func (aec *AesCipher) Encrypt(data, tag []byte) error

func (*AesCipher) Init

func (aec *AesCipher) Init(server bool, key []byte) error

type Cipher

type Cipher interface {
	Init(server bool, key []byte) error
	Encrypt(data, tag []byte) error
	Decrypt(data, tag []byte) error
}

Cipher describes some method for setting up an encryption layer over a TCP socket.

func NewCipher

func NewCipher(version vsn.Build, sessionKey []byte, server bool) (Cipher, error)

type DummyCipher

type DummyCipher struct {
}

func (DummyCipher) Decrypt

func (d DummyCipher) Decrypt(data, tag []byte) error

func (DummyCipher) Encrypt

func (d DummyCipher) Encrypt(data, tag []byte) error

func (DummyCipher) Init

func (d DummyCipher) Init(server bool, key []byte) error

type SessionKeyGenerator

type SessionKeyGenerator struct {
	HashFunc func() hash.Hash
	Seeds    [3][]byte
}

func NewSessionKeyGenerator

func NewSessionKeyGenerator(hashFunc func() hash.Hash, data []byte) *SessionKeyGenerator

func (*SessionKeyGenerator) Read

func (skg *SessionKeyGenerator) Read(data []byte) (int, error)

Directories

Path Synopsis
Package arc4 provides multiple implementations of RC4-based socket encryption methods.
Package arc4 provides multiple implementations of RC4-based socket encryption methods.

Jump to

Keyboard shortcuts

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