Package Exports
- jwt-falcon
- jwt-falcon/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jwt-falcon) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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.