jwt-falcon
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

JWT-falcon

test Publish NPM package NPM package

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.

Package Sidebar

Install

npm i jwt-falcon

Weekly Downloads

1

Version

0.0.12

License

MIT

Unpacked Size

6.7 kB

Total Files

9

Last publish

Collaborators

  • nexys