Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
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 do 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 likely not be merging or reviewing pull requests.
FAQs
A public-private key library for post-quantum cryptography (early stage, use with caution)
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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.