New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@chainsafe/libp2p-noise

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainsafe/libp2p-noise

Noise libp2p handshake for js-libp2p

  • 16.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

@chainsafe/libp2p-noise

npm License Apache 2.0 License MIT Twitter Discord

Noise libp2p handshake for js-libp2p

About

This repository contains TypeScript implementation of noise protocol, an encryption protocol used in libp2p.

Usage

Install with yarn add @chainsafe/libp2p-noise or npm i @chainsafe/libp2p-noise.

Example of using default noise configuration and passing it to the libp2p config:

import {createLibp2p} from "libp2p"
import {noise} from "@chainsafe/libp2p-noise"

//custom noise configuration, pass it instead of `noise()`
//x25519 private key
const n = noise({ staticNoiseKey });

const libp2p = await createLibp2p({
  connectionEncrypters: [noise()],
  //... other options
})

See the NoiseInit interface for noise configuration options.

API

This module exposes an implementation of the ConnectionEncrypter interface.

Bring your own crypto

You can provide a custom crypto implementation (instead of the default, based on @noble) by adding a crypto field to the init argument passed to the Noise factory.

The implementation must conform to the ICryptoInterface, defined in https://github.com/ChainSafe/js-libp2p-noise/blob/master/src/crypto.ts

Install

$ npm i @chainsafe/libp2p-noise

Browser <script> tag

Loading this module through a script tag will make its exports available as ChainsafeLibp2pNoise in the global namespace.

<script src="https://unpkg.com/@chainsafe/libp2p-noise/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Keywords

FAQs

Package last updated on 11 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc