npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cryptokuznechik

v1.1.1

Published

An npm package that provides cryptography russian algorithm 'kuznechik' (GOST 34.12-2018)

Downloads

45

Readme

This is a simple package that provides a russian cryptography algorithm "kuznechik" (GOST 34.12-2018)

How to install

To install this package enter command below to terminal: npm install cryptokuznechik

Usage

To use this package firstly you need to choose one of the encryption mods:

  • ECB
  • OFB
  • CFB
  • CTR
  • OFB

ECB

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);

CBC

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);

CFB

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);

CTR

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);

OFB

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);

Other

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

Authors

* lokt02
* KostylevVadim

Special thanks

* PotatoHD404