@nodefactory/bls-keystore
Advanced tools
Comparing version 1.0.0-beta3 to 1.0.0-beta4
@@ -8,6 +8,6 @@ "use strict"; | ||
var _random = require("bcrypto/lib/random"); | ||
var _deepmerge = require("../../../utils/deepmerge"); | ||
var _crypto = require("../../../utils/crypto"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -20,3 +20,3 @@ | ||
const DefaultPBKDF2Params = { | ||
salt: (0, _random.randomBytes)(32), | ||
salt: (0, _crypto.randomBytes)(32), | ||
c: 262144, | ||
@@ -23,0 +23,0 @@ dklen: 32, |
@@ -8,6 +8,6 @@ "use strict"; | ||
var _random = require("bcrypto/lib/random"); | ||
var _deepmerge = require("../../../utils/deepmerge"); | ||
var _crypto = require("../../../utils/crypto"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -20,3 +20,3 @@ | ||
const DefaultScryptParams = { | ||
salt: (0, _random.randomBytes)(32), | ||
salt: (0, _crypto.randomBytes)(32), | ||
dklen: 32, | ||
@@ -23,0 +23,0 @@ n: 262144, |
@@ -14,4 +14,2 @@ "use strict"; | ||
var _random = require("bcrypto/lib/random"); | ||
var _buffer = require("buffer"); | ||
@@ -68,3 +66,3 @@ | ||
static encrypt(secret, password, path = "", crypto = _crypto2.CryptoFunction.pbkdf2, kdfSalt = (0, _random.randomBytes)(32), aesIv = (0, _random.randomBytes)(16)) { | ||
static encrypt(secret, password, path = "", crypto = _crypto2.CryptoFunction.pbkdf2, kdfSalt = (0, _crypto.randomBytes)(32), aesIv = (0, _crypto.randomBytes)(16)) { | ||
const kdfModule = new _crypto2.KdfModule({ | ||
@@ -71,0 +69,0 @@ function: crypto, |
@@ -12,1 +12,2 @@ /// <reference types="node" /> | ||
export declare function kdf(password: string, func: CryptoFunction, args: KdfModuleParams): bytes; | ||
export declare function randomBytes(length: number): Buffer; |
@@ -11,2 +11,3 @@ "use strict"; | ||
exports.kdf = kdf; | ||
exports.randomBytes = randomBytes; | ||
@@ -61,2 +62,11 @@ var _sha = _interopRequireDefault(require("bcrypto/lib/sha256")); | ||
} | ||
//# sourceMappingURL=crypto.js.map | ||
function randomBytes(length) { | ||
if (process && process.env.ELECTRON) { | ||
//electron | ||
return require("bcrypto/lib/node/random").randomBytes(length); | ||
} else { | ||
return require("bcrypto/lib/random").randomBytes(length); | ||
} | ||
} | ||
//# sourceMappingURL=crypto.js.map |
{ | ||
"name": "@nodefactory/bls-keystore", | ||
"version": "1.0.0-beta3", | ||
"version": "1.0.0-beta4", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -11,4 +11,8 @@ # @nodefactory/bls-keystore | ||
##### Electron usage | ||
- Set env variable ELECTRON=true because electron replaces openssl with BoreSSL which | ||
causes some incompatibilities when using native modules. | ||
### How to use? | ||
```javascript | ||
@@ -15,0 +19,0 @@ import {Buffer} from "buffer"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
67953
878
46
0
2