secure

package
v0.0.0-...-f14c483 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

provides connection encryption

Index

Constants

View Source
const (
	// fixed key size in byte
	KeySize = 32

	// rounds of iteration for pbkdf2
	KeyIteration = 4096
)

Variables

View Source
var (
	ErrInvalidPassword = errors.New("invalid password")
)

Functions

func ReceiveHandshake

func ReceiveHandshake(conn net.Conn, password []byte) (cipher.Stream, error)

func SendHandshake

func SendHandshake(conn net.Conn, password []byte) (cipher.Stream, error)

Types

type EncryptedConnection

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

func NewEncryptedConnection

func NewEncryptedConnection(conn net.Conn, password []byte) *EncryptedConnection

func (*EncryptedConnection) Close

func (c *EncryptedConnection) Close() error

func (*EncryptedConnection) Read

func (c *EncryptedConnection) Read(b []byte) (n int, err error)

func (*EncryptedConnection) Write

func (c *EncryptedConnection) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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