Documentation ΒΆ
Index ΒΆ
- type BlockCrypt
- func NewAESBlockCrypt(key []byte) (BlockCrypt, error)
- func NewBlowfishBlockCrypt(key []byte) (BlockCrypt, error)
- func NewCast5BlockCrypt(key []byte) (BlockCrypt, error)
- func NewQPPCrypt(key []byte) (BlockCrypt, error)
- func NewSM4BlockCrypt(key []byte) (BlockCrypt, error)
- func NewSalsa20BlockCrypt(key []byte) (BlockCrypt, error)
- func NewTEABlockCrypt(key []byte) (BlockCrypt, error)
- func NewTripleDESBlockCrypt(key []byte) (BlockCrypt, error)
- func NewTwofishBlockCrypt(key []byte) (BlockCrypt, error)
- func NewXTEABlockCrypt(key []byte) (BlockCrypt, error)
- type Listener
- type OnClientInCallback
- type OnNextHopInCallback
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type BlockCrypt ΒΆ
type BlockCrypt interface { // Encrypt encrypts the whole block in src into dst. // Dst and src may point at the same memory. Encrypt(dst, src []byte) // Decrypt decrypts the whole block in src into dst. // Dst and src may point at the same memory. Decrypt(dst, src []byte) }
BlockCrypt defines encryption/decryption methods for a given byte slice. Notes on implementing: the data to be encrypted contains a builtin nonce at the first 16 bytes
func NewAESBlockCrypt ΒΆ
func NewAESBlockCrypt(key []byte) (BlockCrypt, error)
NewAESBlockCrypt https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
func NewBlowfishBlockCrypt ΒΆ
func NewBlowfishBlockCrypt(key []byte) (BlockCrypt, error)
NewBlowfishBlockCrypt https://en.wikipedia.org/wiki/Blowfish_(cipher)
func NewCast5BlockCrypt ΒΆ
func NewCast5BlockCrypt(key []byte) (BlockCrypt, error)
NewCast5BlockCrypt https://en.wikipedia.org/wiki/CAST-128
func NewQPPCrypt ΒΆ added in v1.1.1
func NewQPPCrypt(key []byte) (BlockCrypt, error)
NewQPPCrypt https://link.springer.com/content/pdf/10.1140/epjqt/s40507-023-00164-3.pdf
func NewSM4BlockCrypt ΒΆ
func NewSM4BlockCrypt(key []byte) (BlockCrypt, error)
NewSM4BlockCrypt https://github.com/tjfoc/gmsm/tree/master/sm4
func NewSalsa20BlockCrypt ΒΆ
func NewSalsa20BlockCrypt(key []byte) (BlockCrypt, error)
NewSalsa20BlockCrypt https://en.wikipedia.org/wiki/Salsa20
func NewTEABlockCrypt ΒΆ
func NewTEABlockCrypt(key []byte) (BlockCrypt, error)
NewTEABlockCrypt https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm
func NewTripleDESBlockCrypt ΒΆ
func NewTripleDESBlockCrypt(key []byte) (BlockCrypt, error)
NewTripleDESBlockCrypt https://en.wikipedia.org/wiki/Triple_DES
func NewTwofishBlockCrypt ΒΆ
func NewTwofishBlockCrypt(key []byte) (BlockCrypt, error)
NewTwofishBlockCrypt https://en.wikipedia.org/wiki/Twofish
func NewXTEABlockCrypt ΒΆ
func NewXTEABlockCrypt(key []byte) (BlockCrypt, error)
NewXTEABlockCrypt https://en.wikipedia.org/wiki/XTEA
type Listener ΒΆ
type Listener struct {
// contains filtered or unexported fields
}
Listener represents a UDP server that listens for incoming connections and relays them to the next hop.
func ListenWithOptions ΒΆ
func ListenWithOptions(laddr string, nexthops []string, sockbuf int, timeout time.Duration, crypterIn BlockCrypt, crypterOut BlockCrypt, onClientIn OnClientInCallback, onNextHopIn OnNextHopInCallback, logger *log.Logger) (*Listener, error)
ListenWithOptions initializes a new Listener with the provided options. Parameters: - laddr: Address to listen on. - nexthop: Addresses to forward packets to. - sockbuf: Socket buffer size in bytes. - timeout: Session timeout duration. - crypterIn: Cryptographic handler for decrypting incoming packets. - crypterOut: Cryptographic handler for encrypting outgoing packets. - pre: Prerouting function for processing incoming packets. - post: Postrouting function before forwarding packets to the next hop. - logger: Logger instance for logging.
type OnClientInCallback ΒΆ added in v1.0.6
OnClientInCallback is a callback function that processes incoming packets from clients