
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
var Cryp = require('cryp');
var crypto = require('crypto');
// create a cryp object
var cryp = new Cryp([crypto.pbkdf2Sync('pASsWoRD', 'SaLt', 4096, 32)]);
// encrypt
// cryp.encrypt(data, outputEncoding)
// data: utf-8 string or buffer
// if outputEncoding is undefined, return buffer. Otherwise return string encoded using outputEncoding
var data = cryp.encrypt('hello', 'base64');
// decrypt
// cryp.decrypt(data, [inputEncoding], outputEncoding)
// inputEncoding: the encoding of data. If data is a Buffer then dataEncoding is ignored.
// if outputEncoding is undefined, return buffer. Otherwise return string encoded using outputEncoding
cryp.decrypt(data, 'base64', 'utf8') == 'hello';
var data = cryp.encrypt('hello');
cryp.decrypt(data, 'utf8') == 'hello';
cryp.decrypt(data).toString() == 'hello';
// tamper the data
var data = cryp.encrypt('hello', 'base64');
data = 'a' + data;
// return null
cryp.decrypt(data, 'base64', 'utf8') == null;
// using rotate keys
var data = cryp.encrypt('hello', 'base64');
var cryp2 = new Cryp([
crypto.pbkdf2Sync('NEWpASsWoRD', 'SaLt', 4096, 32),
crypto.pbkdf2Sync('pASsWoRD', 'SaLt', 4096, 32)
]);
cryp2.decrypt(data, 'base64', 'utf8') == 'hello';
// sign data
// cryp.sign(data)
// data: buffer or utf-8 string
// return: signed string
var data = cryp.sign('hello');
cryp.unsign(data) == 'hello';
// tamper the signed data
var data = cryp.sign('hello');
data = 'a' + data;
// return null
cryp.unsign(data) == null;
// using rotate keys
var data = cryp.sign('hello');
var cryp2 = new Cryp([
crypto.pbkdf2Sync('NEWpASsWoRD', 'SaLt', 4096, 32),
crypto.pbkdf2Sync('pASsWoRD', 'SaLt', 4096, 32)
]);
cryp2.unsign(data) == 'hello';
MIT
FAQs
encrypt and decrypt data, sign and verify data
The npm package cryp receives a total of 18 weekly downloads. As such, cryp popularity was classified as not popular.
We found that cryp 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.