libp2p-crypto
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5890635
25
134
86635
2
86
9