Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
scrypt-async
Advanced tools
Fast "async" scrypt implementation in JavaScript.
Works in browsers without throwing "kill slow script" warnings due to configurable interruptStep, which yields from calculation. Compatible even with old versions of IE. Also works with Node.js (but you should really use the C implementation for that).
You can install it via a package manager:
NPM:
$ npm install scrypt-async
Yarn:
$ yarn add scrypt-async
To improve performance with small interruptStep values, use setImmediate
shim,
such as https://github.com/YuzuJS/setImmediate.
Derives a key from password and salt and calls callback with derived key as the only argument.
If interruptStep is set, calculations are interrupted with setImmediate (or zero setTimeout) at the given interruptSteps to avoid freezing the browser. If it's not set or set to zero, the callback is called immediately after the calculation, avoiding setImmediate.
string
or Array
of bytes or Uint8Array
)string
or Array
of bytes or Uint8Array
)function (Array|Uint8Array|string)
)N
— CPU/memory cost parameter (must be power of two;
alternatively, you can specify logN
where N = 2^logN).r
— block size parameterp
— parallelization parameter (default is 1)dkLen
— derived key length (default is 32)interruptStep
— (optional) the amount of loop cycles to execute before the next setImmediate/setTimeout (defaults to 0)encoding
— (optional) result encoding 'base64'
or 'hex'
(result will be a string
), 'binary'
(result will be a Uint8Array
) or undefined (result will be an Array
of bytes).scrypt('mypassword', 'saltysalt', {
N: 16384,
r: 8,
p: 1,
dkLen: 16,
encoding: 'hex'
}, function(derivedKey) {
console.log(derivedKey); // "5012b74fca8ec8a4a0a62ffdeeee959d"
});
Legacy API doesn't support parallelization parameter greater than 1.
string
or Array
of bytes or Uint8Array
)string
or Array
of bytes or Uint8Array
)function (Array|Uint8Array|string)
)'base64'
, 'hex'
, 'binary'
or undefined).When encoding is not set, the result is an Array
of bytes.
BSD-like, see LICENSE file or MIT license at your choice.
FAQs
Fast "async" scrypt implementation in JavaScript.
The npm package scrypt-async receives a total of 2,314 weekly downloads. As such, scrypt-async popularity was classified as popular.
We found that scrypt-async demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.