Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

falcon-crypto

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

falcon-crypto

JavaScript wrapper for a WebAssembly build of Falcon

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

falcon-crypto

Overview

The Falcon post-quantum cryptographic signing scheme compiled to WebAssembly using Emscripten. A simple JavaScript wrapper is provided to make Falcon easy to use in Web applications.

N.B. Unless interoperability with other Falcon implementations is a hard requirement, it is recommended to use superfalcon instead.

Example Usage

import {falcon} from 'falcon-crypto';

const keyPair /*: {privateKey: Uint8Array; publicKey: Uint8Array} */ =
	await falcon.keyPair()
;

const message /*: Uint8Array */ =
	new Uint8Array([104, 101, 108, 108, 111, 0]) // "hello"
;

/* Combined signatures */

const signed /*: Uint8Array */ =
	await falcon.sign(message, keyPair.privateKey)
;

const verified /*: Uint8Array */ =
	await falcon.open(signed, keyPair.publicKey) // same as message
;

/* Detached signatures */

const signature /*: Uint8Array */ =
	await falcon.signDetached(message, keyPair.privateKey)
;

const isValid /*: boolean */ =
	await falcon.verifyDetached(signature, message, keyPair.publicKey) // true
;

console.log(keyPair);
console.log(message);
console.log(signed);
console.log(verified);
console.log(signature);
console.log(isValid);

Keywords

FAQs

Package last updated on 17 Jul 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc