peek

package module
v0.0.0-...-eabd6dc Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2018 License: MIT Imports: 9 Imported by: 0

README

Peek

Peek is a simple transport security layer that requires both endpoints to have a shared secret.

⚠ Do not use this to secure anything important. Use a standard protocol! ⚠

Design Goals

Secure endpoint authentication

An attacker listening to, intercepting, and injecting messages during the authentication handshake should be unable to determine the shared secret or decrypt messages.

Secure transmission

An attacker listening to messages sent once a secure connection has been established should be unable to decrypt messages.

Resistance to replay attacks

An attacker should be unable to resend intercepted messages and have them be accepted by either endpoint of the secure connection.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

Conn is a Peek connection. A session key is negotiated when a new connection is established and subsequent communication is encrypted.

func Dial

func Dial(addr string, secret []byte) (*Conn, error)

Dial sets up and returns a new secured connection over TCP by negotiating a shared session key with the server.

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

Read reads from a secured connection. Once a secure session has been established, decrypts messages from the underlying connection and returns the recovered plaintext.

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

Write writes to a secured connections. Once a secure session has been established, encrypts messages and writes them to underlying connection.

type Listener

type Listener struct {
	net.Listener
	// contains filtered or unexported fields
}

Listener is a Peek listener. It negotiates a session secret with connected clients and encrypts communications.

func Listen

func Listen(addr string, secret []byte) (*Listener, error)

Listen starts listening for new incoming connections on the given interface. When new connections are received, it negotiates a shared session key with the client.

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

Accept accepts the next connection, negotiates a session key, and returns the resulting connection.

Jump to

Keyboard shortcuts

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