Socket
Socket
Sign inDemoInstall

libp2p-crypto

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libp2p-crypto - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

dist/index.js.map

2

lib/ephemeral-keys.js

@@ -29,3 +29,3 @@ 'use strict';

var p = forcePrivate || priv;
return p.derive(pub.getPublic()).toBuffer('le');
return p.derive(pub.getPublic()).toBuffer('be');
};

@@ -32,0 +32,0 @@

{
"name": "libp2p-crypto",
"version": "0.5.0",
"version": "0.6.0",
"description": "Crypto primitives for libp2p",

@@ -34,3 +34,3 @@ "main": "lib/index.js",

"devDependencies": {
"aegir": "^3.0.4",
"aegir": "^8.0.0",
"chai": "^3.5.0",

@@ -55,4 +55,7 @@ "pre-commit": "^1.1.3"

"contributors": [
"dignifiedquire <dignifiedquire@gmail.com>"
"David Dias <daviddias.p@gmail.com>",
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
"Richard Littauer <richard.littauer@gmail.com>",
"greenkeeperio-bot <support@greenkeeper.io>"
]
}

@@ -1,2 +0,2 @@

# JavaScript libp2p Crytpo
# js-libp2p-crypto

@@ -6,2 +6,3 @@ [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)

[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-libp2p-crypto/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-libp2p-crypto?branch=master)

@@ -14,8 +15,37 @@ [![Travis CI](https://travis-ci.org/ipfs/js-libp2p-crypto.svg?branch=master)](https://travis-ci.org/ipfs/js-libp2p-crypto)

## Description
This repo contains the JavaScript implementation of the crypto primitives
needed for libp2p. This is based on this [go implementation](https://github.com/ipfs/go-libp2p-crypto).
## Table of Contents
- [Install](#install)
- [Usage](#usage)
- [Example](#example)
- [API](#api)
- [`generateKeyPair(type, bits)`](#generatekeypairtype-bits)
- [`generateEphemeralKeyPair(curve)`](#generateephemeralkeypaircurve)
- [`keyStretcher(cipherType, hashType, secret)`](#keystretcherciphertype-hashtype-secret)
- [`marshalPublicKey(key[, type])`](#marshalpublickeykey-type)
- [`unmarshalPublicKey(buf)`](#unmarshalpublickeybuf)
- [`marshalPrivateKey(key[, type])`](#marshalprivatekeykey-type)
- [`unmarshalPrivateKey(buf)`](#unmarshalprivatekeybuf)
- [Contribute](#contribute)
- [License](#license)
## Install
```sh
npm install --save libp2p-crypto
```
## Usage
### Example
```js
const crypto = require('libp2p-crypto')
var keyPair = crypto.generateKeyPair('RSA', 2048)
```
## API

@@ -94,1 +124,13 @@

Converts a protobuf serialized private key into its representative object.
## Contribute
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-libp2p-crypto/issues)!
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)
## License
[MIT](LICENSE)

@@ -29,3 +29,3 @@ 'use strict'

const p = forcePrivate || priv
return p.derive(pub.getPublic()).toBuffer('le')
return p.derive(pub.getPublic()).toBuffer('be')
}

@@ -32,0 +32,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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