Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
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 1 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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.