Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
encrypt-stack
Advanced tools
An encryption driver/stack to create a multi-layer encrypted workflow in Node.
A nice multi-stack encryption module. Supports several levels of encryption, not that it's really neccessary. By default, the stack size is 3, utilising Blowfish with a 442-bit IV for each layer.
It's simple, just install it from npm. No external dependencies, should automatically install any additional npm packages.
npm i encrypt-stack
The module exports a class you can use for you key exchange, encryption and decryption. You can also specify your own encryption method to use, or a different key exchange protocol. By default, it's set to 'bf-cbc' and 'secp521r1'. Preferably, the key exchange would be Curve25519 (X25519), however 'secp521r1' is still not bad by any means. The encryption and key exchange method must be a string, referring to any supported NodeJS Crypto method respectively.
new EncryptionStack([stack size], [encryption method], [key exchange method])
Below is a simple alice and bob example of how the stack is used. Stack can be set to 1 to use just a single, simple encryption driver. However, it could also be set as high as 100 for some insane reason if you think that's a good idea.
const EncryptionStack = require("encrypt-stack");
const alice = new EncryptionStack();
const bob = new EncryptionStack();
alice.computeSecret(bob.keys());
bob.computeSecret(alice.keys());
const e = alice.encrypt("hello world"); // hex encrypted data of "hello world"
const d = bob.decrypt(e); // returns the original "hello world" string, if everything went well
const h = alice.hash("some data"); // returns a sha512 hash of "some data"
I ran some super simple benchmarks, there's probably a better way of doing it, but it still produced some reasonable results. The number inside the brackets is the stack size, the first timing is the total stack time (for both clients), the second is the estimated time experienced by a single client (on key generation and single element encryption).
[1] 30ms : 15ms
[2] 50ms : 25ms
[3] 79ms : 39.5ms
[4] 106ms : 53ms
[5] 126ms : 63ms
[6] 154ms : 77ms
[7] 179ms : 89.5ms
[8] 202ms : 101ms
[9] 226ms : 113ms
[10] 254ms : 127ms
[11] 276ms : 138ms
[12] 316ms : 158ms
[13] 345ms : 172.5ms
[14] 410ms : 205ms
[15] 487ms : 243.5ms
[16] 627ms : 313.5ms
[17] 875ms : 437.5ms
[18] 1391ms : 695.5ms
[19] 2342ms : 1171ms
[20] 4236ms : 2118ms
FAQs
An encryption driver/stack to create a multi-layer encrypted workflow in Node.
The npm package encrypt-stack receives a total of 0 weekly downloads. As such, encrypt-stack popularity was classified as not popular.
We found that encrypt-stack 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.