![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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 5 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.