A browser-based tool for measuring and comparing performance characteristics of post-quantum cryptographic algorithms.
This project provides a benchmarking environment for testing various post-quantum cryptographic implementations against each other. It allows developers and researchers to evaluate performance metrics across key generation, encryption/signing, and decryption/verification operations for multiple algorithm families.
- Multi-Algorithm Support: Benchmarks several post-quantum algorithm implementations
- Customizable Testing: Configure iteration counts per algorithm
- Interactive Visualization: Generate charts for visual performance comparison
- Exportable Results: Download benchmark data as JSON for further analysis
- Client-Side Processing: All benchmarks run directly in the browser environment
- NIST's selected standard for key encapsulation
- Lattice-based security with configurable parameters
- Measures key generation, encapsulation, and decapsulation
- NIST's selected standard for digital signatures
- Three security levels: ML-DSA44, ML-DSA65, and ML-DSA87
- Measures key generation, signing, and verification
- Lattice-based signature scheme with efficient verification
- Generates relatively small signatures
- Measures key generation, signing, opening, and verification operations
- Implementation of the CRYSTALS-Dilithium signature algorithm
- Measures key generation, signing, and verification
- Supports both attached and detached signatures
- Stateless hash-based signature scheme
- Conservative design based purely on hash function security
- Measures key generation, signing, and verification operations
This project uses the following libraries:
- @noble/post-quantum - JavaScript implementations of NIST PQC standards
- ML-KEM (Kyber) key encapsulation
- ML-DSA (Dilithium) signatures
- SPHINCS+ signatures
- falcon-crypto (v1.0.6) - Pure JavaScript implementation of the Falcon signature algorithm
- dilithium-crystals (v1.0.6) - JavaScript implementation of CRYSTALS-Dilithium signatures
- Chart.js (v4.4.9) - JavaScript charting library for generating interactive visualizations
- Used components: LinearScale, CategoryScale, BarController, BarElement, Legend, Tooltip
- @noble/post-quantum/utils - Helper utilities for conversion and randomization
- utf8ToBytes - Text encoding
- randomBytes - Secure random number generation
All libraries are loaded via ESM imports from CDN sources, eliminating the need for local dependencies or build processes.
The system is built around these core components:
- Benchmarking Engine: Core measurement infrastructure
- Crypto Module Wrappers: Standard interfaces to various cryptographic implementations
- Chart Generation: Data visualization for benchmark results
- UI Controller: Manages the user interface and test configuration
- Select algorithms to benchmark by checking their respective boxes
- Set iteration counts for each selected algorithm
- Click "Start Benchmark" to begin the testing process
- After completion, view the visual results in the generated charts
- Optionally download the raw results as JSON for further analysis
Each algorithm can be configured with:
- Iterations: Higher values provide more accurate results but increase benchmark duration
- Algorithm Selection: Enable/disable specific algorithms to focus testing
When running benchmarks:
- Browser performance may significantly impact results
- Higher iteration counts provide more statistically significant results
- Consider your device capabilities when setting iteration values
- For consistent results, close other resource-intensive applications
- Run benchmarks multiple times to account for variability
For each cryptographic operation:
- Time measurement begins (using Performance API)
- Operation is executed the configured number of times
- Time measurement ends
- Average time and total operations per second are calculated
The tool uses ES modules to provide:
- Isolated testing environments for each algorithm
- Standard measurement interfaces
- Easy addition of new algorithms
- Consistent data visualization
To implement a new algorithm benchmark:
- Create a new module in
scripts/benchmarks/ - Import the cryptographic library (preferably as an ES module)
- Implement the benchmark function with standard measurement wrappers
- Update the UI to include the new algorithm option
- Pure JavaScript: Core benchmarking functionality
- Chart.js: Visualization of benchmark results
- ES Modules: Clean organization of benchmark implementations
- Performance API: Precise timing measurements
- Web Crypto API: Used by some underlying algorithms
This project is for educational and research purposes.