Node.js SDK for Abhedya: Sanskrit-Encoded Post-Quantum Cryptography
npm install @abhedyam/sdkUnmatched Speed. Unbreakable Security.
Abhedya is a high-performance Post-Quantum Cryptography (PQC) library enabling Sanskrit-Encoded encryption. This SDK provides Node.js bindings to the optimized Rust core.
- Quantum Safety: Lattice-based LWE implementation ($N=768$).
- Dual Mode:
- Standard: High-throughput binary encryption.
- Metered: Steganographic mode producing Sanskrit-metered ciphertexts.
- Performance: High-speed C-FFI using koffi (Node.js 25+ compatible).
- Zero-Copy: Efficient buffer management.
``bash`
npm install @abhedyam/sdk
`javascript
const { Abhedya, EncryptionMode } = require("@abhedyam/sdk");
// Initialize
const sdk = new Abhedya();
// 1. Generate KeyPair
console.log("Generating Keys...");
const keys = sdk.keygen();
// keys.publicKey, keys.secretKey (Buffers)
// 2. Encrypt
const message = "The quick brown fox";
const ciphertext = sdk.encrypt(
keys.publicKey,
message,
EncryptionMode.STANDARD,
);
// 3. Decrypt
const plaintext = sdk.decrypt(keys.secretKey, ciphertext);
console.log("Decrypted:", plaintext.toString());
`
Returns { publicKey: Buffer, secretKey: Buffer }.
- publicKey: Buffermessage
- : String or Buffermode
- : EncryptionMode.STANDARD (0) or EncryptionMode.METERED (1)Buffer
- Returns: (Ciphertext)
- secretKey: Bufferciphertext
- : BufferBuffer`
- Returns:
MIT License.