ecies-geth
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
"use strict"; | ||
/* | ||
MIT License | ||
Copyright (c) 2019 Edgewhere | ||
Copyright (c) 2019 Cyril Dever | ||
@@ -30,3 +31,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* Browser ecies-geth implementation. | ||
* This is based off the eccrypto js module. | ||
* This is based off the `eccrypto` JS module. | ||
*/ | ||
@@ -37,5 +38,4 @@ var elliptic_1 = require("elliptic"); | ||
var subtle = (crypto.subtle || crypto.webkitSubtle); | ||
if (subtle === undefined || crypto === undefined) //TODO maybe better ? | ||
//throw new Error('crypto and/or subtle api unavailable') | ||
console.error('crypto and/or subtle api unavailable'); | ||
if (subtle === undefined || crypto === undefined) | ||
throw new Error('crypto and/or subtle api unavailable'); | ||
// Use the browser RNG | ||
@@ -42,0 +42,0 @@ var randomBytes = function (size) { |
export {}; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
"use strict"; | ||
/* | ||
MIT License | ||
Copyright (c) 2019 Edgewhere | ||
Copyright (c) 2019 Cyril Dever | ||
@@ -7,0 +8,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
{ | ||
"name": "ecies-geth", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "JavaScript Elliptic Curve Integrated Encryption Scheme (ECIES) Library - Based off Geth's implementation", | ||
@@ -16,3 +16,3 @@ "main": "dist/lib/src/typescript/index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/edgewhere/ecies-geth.git" | ||
"url": "git+https://github.com/cyrildever/ecies-geth.git" | ||
}, | ||
@@ -31,8 +31,8 @@ "keywords": [ | ||
], | ||
"author": "Edgewhere <cdever@edgewhere.fr>", | ||
"author": "Cyril Dever <cdever@edgewhere.fr>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/edgewhere/ecies-geth/issues" | ||
"url": "https://github.com/cyrildever/ecies-geth/issues" | ||
}, | ||
"homepage": "https://github.com/edgewhere/ecies-geth#readme", | ||
"homepage": "https://github.com/cyrildever/ecies-geth#readme", | ||
"devDependencies": { | ||
@@ -50,3 +50,3 @@ "@types/chai": "^4.2.10", | ||
"ts-node": "^8.10.1", | ||
"typescript": "^3.9.2" | ||
"typescript": "~3.9.2" | ||
}, | ||
@@ -58,3 +58,6 @@ "dependencies": { | ||
"secp256k1": "^3.8.0" | ||
}, | ||
"resolutions": { | ||
"websocket-extensions": "0.1.4" | ||
} | ||
} |
# ecies-geth | ||
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/edgewhere/ecies-geth) | ||
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/cyrildever/ecies-geth) | ||
![npm](https://img.shields.io/npm/dw/ecies-geth) | ||
![GitHub last commit](https://img.shields.io/github/last-commit/edgewhere/ecies-geth) | ||
![GitHub issues](https://img.shields.io/github/issues/edgewhere/ecies-geth) | ||
![GitHub last commit](https://img.shields.io/github/last-commit/cyrildever/ecies-geth) | ||
![GitHub issues](https://img.shields.io/github/issues/cyrildever/ecies-geth) | ||
![NPM](https://img.shields.io/npm/l/ecies-geth) | ||
@@ -15,3 +15,3 @@ | ||
Edgewhere needed to have a JavaScript library fully compliant with the way the Go Ethereum ECIES module ([`ecies`](https://godoc.org/github.com/ethereum/go-ethereum/crypto/ecies)) was implemented. | ||
We needed to have a JavaScript library fully compliant with the way the Go Ethereum ECIES module ([`ecies`](https://godoc.org/github.com/ethereum/go-ethereum/crypto/ecies)) was implemented. | ||
[Parity](https://www.parity.io/) has implemented ECIES encryption and decryption for arbitrary messages through its extended [JSON RPC API](https://wiki.parity.io/JSONRPC-parity-module.html) and has started translating it into a JavaScript library ([`ecies-parity`](https://www.npmjs.com/package/ecies-parity)). But issues remain in the latter and needed a pass to correct them. | ||
@@ -22,3 +22,3 @@ | ||
As with `eccrypto`, this library provides two implementations for Browser and NodeJS with the same API. | ||
As with `eccrypto`, this library provides two implementations for Browser and NodeJS with the same API. | ||
@@ -32,3 +32,3 @@ The ECIES implementation details mimic those introduced by both Geth and Parity, which are: | ||
The ECIES implementation given here is solely based off Geth's and Parity's implementations. This module offers no guarantee as to the security or validity of the implementation. Furthermore, this project is being actively developed and as such should not be used for highly sensitive informations. | ||
The ECIES implementation given here is solely based off Geth's and Parity's implementations. This module offers no guarantee as to the security or validity of the implementation. Furthermore, this project is being actively developed and as such should not be used for highly sensitive informations. | ||
@@ -59,3 +59,3 @@ | ||
ecies.decrypt(privateKeyB, encrypted).then(function(plaintext) { | ||
console.log("Message to part B:", plaintext.toString()); | ||
console.log("Message to part B", plaintext.toString()); | ||
}); | ||
@@ -68,3 +68,3 @@ }); | ||
ecies.decrypt(privateKeyA, encrypted).then(function(plaintext) { | ||
console.log("Message to part A:", plaintext.toString()); | ||
console.log("Message to part A", plaintext.toString()); | ||
}); | ||
@@ -112,3 +112,3 @@ }); | ||
ecies.derive(privateKeyB, publicKeyA).then(function(sharedKey2) { | ||
console.log("Both shared keys are equal:", sharedKey1, sharedKey2); | ||
console.log("Both shared keys are equal", sharedKey1, sharedKey2); | ||
}) | ||
@@ -118,3 +118,7 @@ }) | ||
### Credits | ||
Thanks to [@Methrat0n](https://github.com/Methrat0n/) for the initial adaptation. | ||
### License | ||
@@ -127,2 +131,2 @@ | ||
<hr /> | ||
© 2019-2020 Edgewhere SAS. All rights reserved. | ||
© 2019-2020 Cyril Dever. All rights reserved. |
Sorry, the diff of this file is not supported yet
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
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
124
36391
642