Skip to content

johnb8005/jwt-falcon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

JSON Web Tokens (JWT) library for Node.js using the Falcon cryptographic algorithm

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published