@logismika/crypto
Version:
Crypto algorithms library
39 lines (24 loc) • 699 B
Markdown
Implementation of the Kuznechik encryption algorithm according to GOST 34.12 - 2015.
To install and set up the library, run:
```sh
$ npm install @logismika/crypto
```
```ts
const encryptedData = await encrypt("Secret", new Uint8Array([1, 2, 3]));
```
```ts
const decryptedData = await decrypt("Secret", encryptedData);
```
```ts
import { decrypt, encrypt } from "@logismika/crypto";
const secretKey = "Secret";
const dataToEncrypt = new Uint8Array([1, 1, 1, 100, 100, 200]);
const encryptedData = await encrypt(secretKey, dataToEncrypt);
const decryptedData = await decrypt(secretKey, encryptedData);
```