
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
cryptokuznechik
Advanced tools
An npm package that provides cryptography russian algorithm 'kuznechik' (GOST 34.12-2018)
This is a simple package that provides a russian cryptography algorithm "kuznechik" (GOST 34.12-2018)
To install this package enter command below to terminal:
npm install cryptokuznechik
To use this package firstly you need to choose one of the encryption mods:
For ECB you need to import class ECB from package:
import {ECB} from 'cryptokuznechik';
Next create an instance of ECB:
let ecb:ECB = new ECB();
Now you can encrypt and decrypt messages:
const fs = require('fs');
let inputString: string = fs.readFileSync("input.txt", "utf8");
let encrypted: Buffer = ecb.Encrypt(Buffer.from(inputString));
let result: Buffer = ecb.Decrypt(encrypted);
For CBC you need to import class CBC from package:
import {CBC} from 'cryptokuznechik';
Next create an instance of CBC:
let cbc:CBC = new CBC();
Now encrypt and decrypt messages:
let buffer: Buffer = Buffer.from(inputString);
let cbc_enc: Buffer = cbc.Encrypt(buffer);
let result: Buffer = cbc.Decrypt(cbc_enc);
For CFB you need to import class CFB from package:
import {CFB} from 'cryptokuznechik';
Next create an instance of CFB:
let cfb:CFB = new CFB();
Now encrypt and decrypt messages:
let cfb_enc: Buffer = cfb.Encrypt(buffer);
let result: Buffer = cfb.Decrypt(cfb_enc);
For CTR you need to import class CTR from package:
import {CTR} from 'cryptokuznechik';
Next create an instance of CTR:
let ctr:CTR = new CTR();
Now encrypt and decrypt messages:
let ctr_enc: Buffer = ctr.Encrypt(buffer);
let result: Buffer = ctr.Decrypt(ctr_enc);
For OFB you need to import class OFB from package:
import {OFB} from 'cryptokuznechik';
Next create an instance of OFB:
let ofb:OFB = new OFB();
Now encrypt and decrypt messages:
let ofb_enc: Buffer = ofb.Encrypt(buffer);
let result: Buffer = ofb.Decrypt(ofb_enc);
You also can create your own encryption mode with Kuznec:
import {Kuznec} from 'cryptokuznechik'
let kuz: Kuznec = new Kuznec();
let block: Buffer = Buffer.from('plainTextBlock12');
let encrypted_block: Buffer = kuz.Encryption(block);
let decrypted_block: Buffer = kuz.Decryption(encrypted_block);
console.log(decrypted_block.toString('utf-8')); //// plainTextBlock12
* lokt02
* KostylevVadim
* PotatoHD404
FAQs
An npm package that provides cryptography russian algorithm 'kuznechik' (GOST 34.12-2018)
We found that cryptokuznechik demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.