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.
A public-private key library for post-quantum cryptography (early stage, use with caution)
This library contains a public/private keypair system which can be used for post-quantum encryption between users.
Kyber 1024 was used; however, it was changed to 512 due to the unreasonable size of messages, upwards of 200 KB for a single byte message, scaling at O(n).
In the future, this may be updated to include other PQ encryption standards; however, these are the ones I chose for now.
This library is specifically built for the Bun Runtime. Please install that and replace Node.JS with this runtime, as it is much faster.
Afterwards, run bun add epolite
to install this package, and then use the documentation below.
import {createKeyPair, type KeyPair} from "epolite";
//returns an object containing {publicKey: string, privateKey: string}
const kp: KeyPair = await createKeyPair();
console.log(kp.publicKey, kp.privateKey);
import {encrypt} from "epolite";
//publicKey is a string, starting with "----------BEGIN EPOLITE PUBLIC KEY----------"
//returns a base64 encoded string of the encrypted message
const encryptedString: string = await encrypt("deadbeef", publicKey);
console.log("Very, very long encrypted string:", encryptedString);
import {decrypt} from "epolite";
//returns the decrypted message as a string
const decryptedString: string = await decrypt(encryptedString, privateKey);
console.log("Decrypted message:", decryptedString);
import {sign} from "epolite";
//returns a base64 encoded string (signatures aren't too big).
const signedMessage: string = await sign("I do not like pineapple pizza", privateKey);
console.log("Signed message:", signedMessage);
import {verify} from "epolite";
const realMessage: string = "I do not like pineapple pizza";
const fakeMessage: string = "I LOVE pineapple on pizza";
const verified: boolean = await verify(realMessage, signedMessage, publicKey); //true
const notVerified: boolean = await verify(fakeMessage, signedMessage, publicKey); //false
You can find an example in src/test.ts
.
Since this is for my own project, I probably will not merge or review pull requests.
FAQs
A public-private key library for post-quantum cryptography (early stage, use with caution)
The npm package epolite receives a total of 62 weekly downloads. As such, epolite popularity was classified as not popular.
We found that epolite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.