jwt-falcon
v0.0.12
Published
A lightweight JavaScript library for generating and verifying JSON Web Tokens (JWT) using the Falcon cryptographic algorithm, a lattice-based signature scheme that is post-quantum (PQ) proof and resistant to attacks from quantum computers.
Downloads
11
Maintainers
Readme
JWT-falcon
A lightweight JavaScript library for generating and verifying JSON Web Tokens (JWT) using the Falcon cryptographic algorithm, a lattice-based signature scheme that is post-quantum (PQ) proof and resistant to attacks from quantum computers. Features
- Generates JWTs using the Falcon algorithm
- Verifies JWTs using the Falcon algorithm
- Decodes JWTs to extract the payload
Install
Install the package: npm install jwt-falcon
Example
import Falcon from "falcon-crypto";
import { sign, verify, decode } from "jwt-falcon";
import { generateRandomString } from "./utils.js";
const falcon = F.falcon;
const keyPair = await falcon.keyPair();
const message = { message: generateRandomString() };
// sign and get JWT
const jwt = await sign(message, keyPair.privateKey);
// decode and verify
const decoded = await decode(jwt);
const verified = await verify(jwt, keyPair.publicKey);
License
This library is licensed under the MIT License.
Contributing
Contributions are welcome! Please submit a pull request with your changes.