This is a Next.js demo application showcasing the capabilities of the @nillion/blindfold
cryptographic library.
The demo includes interactive pages for cryptographic operations:
- Store: Encrypt and decrypt data using symmetric encryption or XOR secret sharing
- Match: Perform equality comparisons on encrypted data without decryption
- Sum: Add encrypted integers using homomorphic encryption or secret sharing
- Decrypt: Decrypt shared encrypted data using provided shares and keys
- Node.js 20 or later
- npm or pnpm
npm install
npm run dev
Open http://localhost:3000 in your browser to see the demo.
Each demo page allows you to:
- Select the number of nodes (1-10) using a slider
- Choose key type (SecretKey with seed or ClusterKey)
- Enter data to encrypt (strings or integers)
- Encrypt the data with the selected configuration
- Perform operations on the encrypted data
- Decrypt the results to verify correctness
The Store page includes a sharing feature:
- After encrypting data, click "SHARE ENCRYPTED DATA"
- A new tab opens with the decrypt page containing the encrypted shares
- Share this URL with others who have the decryption key/seed
- Recipients enter the seed to decrypt the data
- Supports UTF-8 strings (up to 4096 bytes) and 32-bit signed integers
- Single node: Uses XSalsa20 stream cipher with Poly1305 MAC
- Multi-node: Uses XOR-based secret sharing
- Share encrypted data: Click "SHARE ENCRYPTED DATA" to open a decrypt link with the encrypted shares
- Supports both SecretKey (with deterministic seed) and ClusterKey
- Compare two encrypted values for equality
- Uses deterministic salted hashing (SHA-512)
- Equal plaintexts produce equal ciphertexts
- Supports both strings and integers
- Add encrypted 32-bit signed integers
- Single node: Paillier homomorphic encryption
- Multi-node: Additive secret sharing
- Compute sums without decrypting individual values
- Decrypt data shared from the Store page
- Accepts encrypted shares via URL parameters
- Visual node representation shows encrypted shares
- Requires the original seed for SecretKey decryption
- Supports editing shares if needed
The application uses:
- Next.js 15 with App Router
- TypeScript for type safety
- Tailwind CSS for styling
- @nillion/blindfold for cryptographic operations