Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hybrid Quantum-Resistant Signature Scheme

A WebAssembly-accelerated implementation of a hybrid signature scheme that combines classical ECDSA with post-quantum CRYSTALS-Dilithium.

Overview

This project implements a hybrid signature scheme that satisfies three key properties from academic literature:

  1. Proof Composability - Signatures can be verified independently
  2. Strong Non-Separability - Signatures are linked through a shared challenge
  3. Simultaneous Verification - Signature can be verified in a single operation

The implementation uses WebAssembly for performance optimization through the dilithium-crystals library.

Features

  • Hybrid key generation combining ECDSA (secp256k1) and CRYSTALS-Dilithium
  • Standard signature approach (separate signatures concatenated)
  • True hybrid FS-FS approach (Fiat-Shamir with shared challenge)
  • Constant-time challenge verification for security
  • WebAssembly acceleration for Dilithium operations
  • Performance benchmarking between approaches

Installation

npm install

Usage

const hybridSignature = require('./lib/hybrid-signature-wasm-final');

async function example() {
  // Generate a key pair
  const keyPair = await hybridSignature.generateKeyPair();
  
  // Create a message
  const message = Buffer.from('This is a secure message');
  
  // Sign the message
  const signature = await hybridSignature.signHybrid(message, keyPair.privateKey);
  
  // Verify the signature
  const isValid = await hybridSignature.verifyHybrid(message, signature, keyPair.publicKey);
  console.log('Signature is', isValid ? 'valid' : 'invalid');
}

example();

API

generateKeyPair()

Generates a hybrid key pair containing both ECDSA and Dilithium keys.

signStandard(message, privateKey)

Signs a message using the standard approach (separate signatures).

verifyStandard(message, signature, publicKey)

Verifies a message signed with the standard approach.

signHybrid(message, privateKey)

Signs a message using the true hybrid FS-FS approach with shared challenge.

verifyHybrid(message, signature, publicKey)

Verifies a message signed with the true hybrid approach.

Running Tests

# Run the final implementation test
npm run test-hybrid-final

# Run a simple demo
npm run demo-hybrid-wasm

Security Notes

This implementation is provided for research and educational purposes. Before using in a production environment:

  1. Conduct a thorough security audit
  2. Implement proper key management practices
  3. Consider the tradeoffs of increased signature size and computational overhead

License

MIT

About

A WebAssembly-accelerated implementation of a hybrid signature scheme that combines classical ECDSA with post-quantum CRYSTALS-Dilithium.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages