Vanilla JavaScript implementation of the Kuznechik (GOST R 34.12-2015) symmetric block cipher.
- Full support for 256-bit keys and 128-bit blocks.
- Optimized for performance with precomputed inverse S-box and round constants.
- Verified against standard GOST R 34.12-2015 test vectors.
- No dependencies.
Just copy kuznechik.js to your project or use require:
const { Kuznechik } = require("./kuznechik");const key = new Uint8Array([
/* 32 bytes */
]);
const cipher = new Kuznechik(key);
const plaintext = new Uint8Array([
/* 16 bytes */
]);
const ciphertext = cipher.encrypt(plaintext);
const decrypted = cipher.decrypt(ciphertext);Run the included test suite:
npm testMIT