noise

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0, MIT Imports: 3 Imported by: 65

README

DEPRECATION NOTICE

This package has moved into go-libp2p as a sub-package, github.com/libp2p/go-libp2p/p2p/security/noise.

go-libp2p-noise

Discourse posts GoDoc Build Status

go-libp2p's noise encrypted transport

go-libp2p-noise is a component of the libp2p project, a modular networking stack for developing peer-to-peer applications. It provides a secure transport channel for go-libp2p based on the Noise Protocol Framework. Following an initial plaintext handshake, all data exchanged between peers using go-libp2p-noise is encrypted and protected from eavesdropping.

libp2p supports multiple transport protocols, many of which lack native channel security. go-libp2p-noise is designed to work with go-libp2p's "transport upgrader", which applies security modules (like go-libp2p-noise) to an insecure channel. go-libp2p-noise implements the SecureTransport interface, which allows the upgrader to secure any underlying connection.

More detail on the handshake protocol and wire format used is available in the noise-libp2p specification. Details about security protocol negotiation in libp2p can be found in the connection establishment spec.

Status

This implementation is currently considered "feature complete," but it has not yet been widely tested in a production environment.

Install

As go-libp2p-noise is still in development, it is not included as a default dependency of go-libp2p.

go-libp2p-noise is a standard Go module which can be installed with:

go get github.com/libp2p/go-libp2p-noise

Usage

go-libp2p-noise is enabled by default when constructing a new libp2p Host.

On a blank host, you can pass noise.New as an argument to a libp2p.Security Option when constructing a libp2p Host with libp2p.New:

import (
  libp2p "github.com/libp2p/go-libp2p"
  noise "github.com/libp2p/go-libp2p-noise"
)

// wherever you create your libp2p instance:
host := libp2p.New(
  libp2p.Security(noise.ID, noise.New)
)

Note that the above snippet will replace the default security protocols. To add Noise as an additional protocol, chain it to the default options instead:

libp2p.ChainOptions(libp2p.DefaultSecurity, libp2p.Security(noise.ID, noise.New))

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the libp2p Code of Conduct.

Want to hack on libp2p?

License

MIT/Apache-2.0


Documentation

Overview

Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/p2p/security/noise.

Index

Constants

View Source
const ID = noise.ID

ID is the protocol ID for noise Deprecated: use github.com/libp2p/go-libp2p/p2p/security/noise.ID instead.

View Source
const LengthPrefixLength = noise.LengthPrefixLength

LengthPrefixLength is the length of the length prefix itself, which precedes all transport messages in order to delimit them. In bytes. Deprecated: use github.com/libp2p/go-libp2p/p2p/security/noise.LengthPrefixLength instead.

View Source
const MaxPlaintextLength = noise.MaxPlaintextLength

MaxPlaintextLength is the maximum payload size. It is MaxTransportMsgLength minus the MAC size. Payloads over this size will be automatically chunked. Deprecated: use github.com/libp2p/go-libp2p/p2p/security/noise.MaxPlaintextLength instead.

View Source
const MaxTransportMsgLength = noise.MaxTransportMsgLength

MaxTransportMsgLength is the Noise-imposed maximum transport message length, inclusive of the MAC size (16 bytes, Poly1305 for noise-libp2p). Deprecated: use github.com/libp2p/go-libp2p/p2p/security/noise.MaxTransportMsgLength instead.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

type Transport = noise.Transport

Transport implements the interface sec.SecureTransport Deprecated: use github.com/libp2p/go-libp2p/p2p/security/noise.Transport instead.

func New

func New(privkey crypto.PrivKey) (*Transport, error)

New creates a new Noise transport using the given private key as its libp2p identity key. Deprecated: use github.com/libp2p/go-libp2p/p2p/security/noise.New instead.

Directories

Path Synopsis
Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/p2p/security/noise/pb.
Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/p2p/security/noise/pb.

Jump to

Keyboard shortcuts

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