tunnel

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCipherNotSupported = errors.New("cipher not supported")

Functions

func NewEncryptedConn

func NewEncryptedConn(c net.Conn, ciph Cipher) net.Conn

NewEncryptedConn wraps a stream-oriented net.Conn with cipher.

func NewReader

func NewReader(r io.Reader, aead cipher.AEAD) io.Reader

NewReader wraps an io.Reader with AEAD decryption.

func NewWriter

func NewWriter(w io.Writer, aead cipher.AEAD) io.Writer

NewWriter wraps an io.Writer with AEAD encryption.

Types

type Cipher

type Cipher interface {
	KeySize() int
	SaltSize() int
	Encrypter(salt []byte) (cipher.AEAD, error)
	Decrypter(salt []byte) (cipher.AEAD, error)
}

func NewAEADCipher

func NewAEADCipher(name string, key []byte, password string) (Cipher, error)

type KeySizeError

type KeySizeError int

func (KeySizeError) Error

func (e KeySizeError) Error() string

Jump to

Keyboard shortcuts

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