
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
For RSA sake! Exposes openssl rsautl
funtions via a C addon rather than shelling out.
$ npm install forsake
:warning: on Windows, either a 32-bit or 64-bit separately-compiled OpenSSL library is required. One can be obtained from slproweb.
n.b. all keys are Buffer
instances
var forsake = require('forsake');
// sign
var a = forsake.sign('this string', private_key);
// with passphrase
var protected_pkey = { key: private_key, passphrase: 'hello' };
var b = forsake.sign('this string', protected_pkey);
// with padding
var c = forsake.sign('this string', pkey, forsake.RSA_X931_PADDING);
// errors
try {
forsake.sign('this string', public_key);
} catch (e) {
e.toString(); //=> "RsaError: Unable to load private key"
e.failures; //=> [ 'error:0906D06C:PEM routines:PEM_read_bio:no start line' ]
}
encrypt
, decrypt
, sign
and verify
is identicalRsaError
which is exposed by forsake
RsaError.failures
contains SSL error strings, which can help identify problemsThe examples below show all possible types of supported key arguments:
var buffer_from_file = fs.readFileSync('id_rsa');
var utf8_string = "-----BEGIN PUBLIC KEY-----\nblah\n-----END PUBLIC KEY-----";
var protected_buffer = { key: buf_from_file, passphrase: 'opensesame' };
var protected_utf8 = { key: utf8_string, passphrase: 'Alohomora' };
Forsake exposes the following padding constants:
RSA_NO_PADDING
RSA_PKCS1_OAEP_PADDING
RSA_PKCS1_PADDING
RSA_SSLV23_PADDING
RSA_X931_PADDING
Forsake is able to read PKCS#8, PKCS#1 and X.509 public keys, and PKCS#8 private keys. Passphrases can be used with private keys and the standard padding options are also available.
ISC
FAQs
For RSA sake! Native bindings for rsautl functions
The npm package forsake receives a total of 0 weekly downloads. As such, forsake popularity was classified as not popular.
We found that forsake 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.