noisecat

package
v0.0.0-...-178df11 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOISE_DH_CURVE25519 = 1
	NOISE_DH_CURVE448   = 2

	NOISE_CIPHER_CHACHAPOLY = 1
	NOISE_CIPHER_AESGCM     = 2

	NOISE_HASH_BLAKE2s = 1
	NOISE_HASH_BLAKE2b = 2
	NOISE_HASH_SHA256  = 3
	NOISE_HASH_SHA512  = 4

	NOISE_PATTERN_NN = 4
	NOISE_PATTERN_NK = 5
	NOISE_PATTERN_NX = 6
	NOISE_PATTERN_XN = 7
	NOISE_PATTERN_XK = 8
	NOISE_PATTERN_XX = 9
	NOISE_PATTERN_KN = 10
	NOISE_PATTERN_KK = 11
	NOISE_PATTERN_KX = 12
	NOISE_PATTERN_IN = 13
	NOISE_PATTERN_IK = 14
	NOISE_PATTERN_IX = 15
)

Variables

View Source
var CipherStrByte = map[string]byte{
	"ChaChaPoly": NOISE_CIPHER_CHACHAPOLY,
	"AESGCM":     NOISE_CIPHER_AESGCM,
}

Cipher Funcs

View Source
var DHStrByte = map[string]byte{
	"25519": NOISE_DH_CURVE25519,
}

DH Funcs

View Source
var HashStrByte = map[string]byte{
	"BLAKE2s": NOISE_HASH_BLAKE2s,
	"BLAKE2b": NOISE_HASH_BLAKE2b,
	"SHA256":  NOISE_HASH_SHA256,
	"SHA512":  NOISE_HASH_SHA512,
}

Hash Funcs

Handshake Patterns

Functions

func GenerateKeypair

func GenerateKeypair(dh, cipher, hash byte) ([]byte, error)

GenerateKeypair generates and outputs private and public keys based on the provided functions

Types

type Config

type Config struct {
	SrcPort string
	SrcHost string
	DstPort string
	DstHost string

	ExecuteCmd string
	Proxy      string
	Listen     bool
	Verbose    bool
	Daemon     bool
	Keygen     bool

	Protocol   string
	Pattern    byte
	DHFunc     byte
	CipherFunc byte
	HashFunc   byte

	PSK     string
	RStatic string
	LStatic string
}

Config parameters

func (*Config) ParseConfig

func (config *Config) ParseConfig() (*noise.Config, error)

ParseConfig parses a configuration struct for setup and correctness

type NoiseInterface

type NoiseInterface interface {
	GetLocalStaticPublic() []byte
}

NoiseInterface intrfaces with noise configurations

type Noisecat

type Noisecat struct {
	Config      *Config
	NoiseConfig *noise.Config
	Log         Verbose
}

Noisecat defines the main network configuration

func (*Noisecat) StartClient

func (n *Noisecat) StartClient()

StartClient starts a noisecat client

func (*Noisecat) StartServer

func (n *Noisecat) StartServer()

StartServer starts a noisecat server

type Params

type Params struct {
	Conn       net.Conn
	Proxy      string
	ExecuteCmd string
	Log        Verbose
}

Params type defines the parameters required by the runners

func (*Params) Router

func (c *Params) Router()

Router routes a connection based on provided parameters

type Progress

type Progress struct {
	Bytes int64
	Dir   string
}

Progress struct

type Verbose

type Verbose bool

Verbose is a logging facility

func (Verbose) Fatalf

func (l Verbose) Fatalf(format string, v ...interface{})

Fatalf prints a messager if Log is true and exits with an error code

func (Verbose) Verb

func (l Verbose) Verb(format string, v ...interface{})

Verb prints a line if Log is true

Jump to

Keyboard shortcuts

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