
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
blowfish-js
Advanced tools
This is a pure Javascript implementation of Blowfish symmetric block cipher algorithm.
const blf = require('./blowfish.js');
const crypto = require('crypto');
{
let key = crypto.randomBytes(32);
let context = blf.key(key);
let plaintext = 'Length is divisible by 8 to match the block size';
let ciphertext = blf.ecb(context, Buffer.from(plaintext, 'utf8'));
let decrypted = blf.ecb(context, ciphertext, true);
}
{
let key = crypto.randomBytes(16);
let iv = crypto.randomBytes(8);
let context = blf.key(key);
let plaintext = 'CBC mode also requires full blocks. Pad input data if necessary.';
let ciphertext = blf.cbc(context, iv, Buffer.from(plaintext, 'utf8'));
let decrypted = blf.cbc(context, iv, ciphertext, true);
}
{
let key = crypto.randomBytes(16);
let iv = crypto.randomBytes(8);
let context = blf.key(key);
let plaintext = 'Same with CFB. Full blocks only!';
let ciphertext = blf.cfb(context, iv, Buffer.from(plaintext, 'utf8'));
let decrypted = blf.cfb(context, iv, ciphertext, true);
}
{
let key = crypto.randomBytes(16);
let iv = crypto.randomBytes(8);
let context = blf.key(key);
let plaintext = 'With OFB, input length can be anything, but remember to use a unique IV every time! Encryption and decryption are identical in this mode.';
let ciphertext = blf.ofb(context, iv, Buffer.from(plaintext, 'utf8'));
let decrypted = blf.ofb(context, iv, ciphertext, true);
}
Test vectors are included into the package. Results of ecb, cbc, cfb, and ofb functions are identical to nodejs crypto subsystem cipher algorithms bf-ecb, bf-cbc, bf-cfb, and bf-ofb respectively.
Timo J. Rinne tri@iki.fi
GPL-2.0
FAQs
Pure Javascript implementation of Blowfish block cipher.
The npm package blowfish-js receives a total of 480 weekly downloads. As such, blowfish-js popularity was classified as not popular.
We found that blowfish-js 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
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.