This project implements the SPHINCS+ post-quantum cryptographic algorithm using Node.js. It includes a native addon written in C/C++ for high-performance cryptographic operations across various platforms, ensuring security against quantum computer attacks.
- Installation
- Usage
- Building and Testing
- Rebuilding Prebuilt Binaries
- Platform Support
- Contributing
- License
To install the necessary dependencies for this project, run:
npm install
This command installs all required Node.js packages, including development dependencies.
Here is a basic example of how to use this library:
const sphincs = require('path_to_your_module');
// Example of signing a message
const message = "Hello, Quantum World!";
const privateKey = "your_private_key"; // Load or generate your SPHINCS+ private key
const signature = sphincs.signMessage(message, privateKey);
// Example of verifying a signature
const publicKey = "your_public_key"; // Load or generate your SPHINCS+ public key
const isValid = sphincs.verifySignature(message, signature, publicKey);
console.log(`Signature valid: ${isValid}`);
To build the project and run tests, follow these steps:
# Clean up previous builds and node_modules
rm -rf build
rm -rf node_modules
node-gyp clean
# Configure and build the project
node-gyp configure
node-gyp build
# Install dependencies
npm install
# Run tests
npm test
These commands ensure that your build environment is clean and that tests are executed using a fresh build.
This project uses prebuild
to create prebuilt binaries for various Node.js versions and platforms. To generate these binaries, use the following commands:
npx prebuild --napi --target 10.0.0 --target 10.6.0 --target 12.11.0 --target 14.0.0 --target 16.0.0 --arch x64 --arch arm64 --strip --verbose
npx prebuild --napi --target 10.0.0 --target 10.6.0 --target 12.11.0 --target 14.0.0 --target 16.0.0 --arch x64 --arch arm64 --platform win32 --strip --verbose
npx prebuild --napi --target 10.0.0 --target 10.6.0 --target 12.11.0 --target 14.0.0 --target 16.0.0 --arch x64 --arch arm64 --platform darwin --strip --verbose
These commands will create prebuilt binaries compatible with multiple Node.js versions and platforms.
This project supports multiple platforms, including:
- Linux (x64, ARM64)
- macOS (x64, ARM64)
- Windows (x64, ARM64)
The prebuilt binaries are optimized for different environments to ensure performance and compatibility.
We welcome contributions from the community! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes.
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more information.
- GitHub Repository: SPHINCS+ Project