0.2.3 • Published 9 months ago

@logismika/crypto v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@logismika/crypto

Implementation of the Kuznechik encryption algorithm according to GOST 34.12 - 2015.

Installation

To install and set up the library, run:

$ npm install @logismika/crypto

Usage

encrypt

const encryptedData = encrypt("Secret", new Uint8Array([1, 2, 3]));

decrypt

const decryptedData = decrypt("Secret", encryptedData, 3);

Note: 3 is a length of decrypted array.

Example

import { decrypt, encrypt } from "@logismika/crypto";

const secretKey = "Secret";
const dataToEncrypt = new Uint8Array([1, 1, 1, 100, 100, 200]);

const len = dataToEncrypt.length;
const encryptedData = encrypt(secretKey, dataToEncrypt);

const decryptedData = decrypt(secretKey, encryptedData, len);
0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago