conn

package
v1.5.23 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 13 Imported by: 2

Documentation

Overview

Package conn makes it possible to hide the structure of the true message by encrypting and adding random bytes.

NETWORK MESSAGE FORMAT

E( LEM || LV || H(LEM||LV) || H(EM||V) ) || EM || V
where
	LEM = L(EM)
	LV  = L(V)
	EM  = E(M)
	where
		E - encrypt (cipher-key)
		H - hmac (auth-key)
		L - length
		M - message bytes
		V - void bytes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IConn

type IConn interface {
	types.ICloser

	GetSettings() ISettings
	GetSocket() net.Conn

	WriteMessage(net_message.IMessage) error
	ReadMessage(chan struct{}) (net_message.IMessage, error)
}

func LoadConn

func LoadConn(pSett ISettings, pConn net.Conn) IConn

func NewConn

func NewConn(pSett ISettings, pAddr string) (IConn, error)

type ISettings

type ISettings interface {
	net_message.ISettings

	// for subsequent inheritance on multiple connections
	SetNetworkKey(string)

	GetMessageSizeBytes() uint64
	GetLimitVoidSize() uint64
	GetWaitReadDeadline() time.Duration
	GetReadDeadline() time.Duration
	GetWriteDeadline() time.Duration
}

func NewSettings

func NewSettings(pSett *SSettings) ISettings

type SSettings

type SSettings sSettings

Jump to

Keyboard shortcuts

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