ethereum-encryption
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -74,2 +74,4 @@ import _Map from 'babel-runtime/core-js/map'; | ||
var _encryptWithPublicKeyEciesCache = new _Map(); | ||
// this key is used as false sample, because bitcore would crash when alice has no privateKey | ||
var _encryptWithPublicKeyDefaultKey = new bitcore.PrivateKey('52435b1ff21b894da15d87399011841d5edec2de4552fdc29c8299574436925d'); | ||
/** | ||
@@ -85,5 +87,3 @@ * encrypts the message with the publicKey | ||
if (!_encryptWithPublicKeyEciesCache.has(publicKey)) { | ||
// this key is used as false sample, because bitcore would crash when alice has no privateKey | ||
var privKey = new bitcore.PrivateKey('52435b1ff21b894da15d87399011841d5edec2de4552fdc29c8299574436925d'); | ||
var _alice = ECIES().privateKey(privKey).publicKey(new bitcore.PublicKey(publicKey)); | ||
var _alice = ECIES().privateKey(_encryptWithPublicKeyDefaultKey).publicKey(new bitcore.PublicKey(publicKey)); | ||
_encryptWithPublicKeyEciesCache.set(publicKey, _alice); | ||
@@ -90,0 +90,0 @@ } |
@@ -109,2 +109,4 @@ 'use strict'; | ||
var _encryptWithPublicKeyEciesCache = new _map2['default'](); | ||
// this key is used as false sample, because bitcore would crash when alice has no privateKey | ||
var _encryptWithPublicKeyDefaultKey = new _bitcoreLib2['default'].PrivateKey('52435b1ff21b894da15d87399011841d5edec2de4552fdc29c8299574436925d'); | ||
/** | ||
@@ -120,5 +122,3 @@ * encrypts the message with the publicKey | ||
if (!_encryptWithPublicKeyEciesCache.has(publicKey)) { | ||
// this key is used as false sample, because bitcore would crash when alice has no privateKey | ||
var privKey = new _bitcoreLib2['default'].PrivateKey('52435b1ff21b894da15d87399011841d5edec2de4552fdc29c8299574436925d'); | ||
var _alice = (0, _ecies2['default'])().privateKey(privKey).publicKey(new _bitcoreLib2['default'].PublicKey(publicKey)); | ||
var _alice = (0, _ecies2['default'])().privateKey(_encryptWithPublicKeyDefaultKey).publicKey(new _bitcoreLib2['default'].PublicKey(publicKey)); | ||
_encryptWithPublicKeyEciesCache.set(publicKey, _alice); | ||
@@ -125,0 +125,0 @@ } |
{ | ||
"name": "ethereum-encryption", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Use this to encrypt, decrypt, sign and verify data with an ethereum public- or privateKey", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -101,2 +101,4 @@ import * as ethUtil from 'ethereumjs-util'; | ||
const _encryptWithPublicKeyEciesCache = new Map(); | ||
// this key is used as false sample, because bitcore would crash when alice has no privateKey | ||
const _encryptWithPublicKeyDefaultKey = new bitcore.PrivateKey('52435b1ff21b894da15d87399011841d5edec2de4552fdc29c8299574436925d'); | ||
/** | ||
@@ -112,6 +114,4 @@ * encrypts the message with the publicKey | ||
if (!_encryptWithPublicKeyEciesCache.has(publicKey)) { | ||
// this key is used as false sample, because bitcore would crash when alice has no privateKey | ||
const privKey = new bitcore.PrivateKey('52435b1ff21b894da15d87399011841d5edec2de4552fdc29c8299574436925d'); | ||
const alice = ECIES() | ||
.privateKey(privKey) | ||
.privateKey(_encryptWithPublicKeyDefaultKey) | ||
.publicKey(new bitcore.PublicKey(publicKey)); | ||
@@ -118,0 +118,0 @@ _encryptWithPublicKeyEciesCache.set( |
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
75787