open-index/open-npm huggingface dataset:
npm package: @li.ziyi/v-element
Description: Vue3 component library
Author: li.ziyi
Latest version: 1.0.0

# Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support For `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
   1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
   2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
npm package: @li0ard/angstrem3
Description: Implementation of the Angstrem-3 algorithm for Elektronika MK-85C in TypeScript
Author: li0ard
Latest version: 0.2.3

![](https://mk.bs0dd.net/mk85c/mk85cf.jpg)

## RUS:

Реализация алгоритма "Ангстрем-3" для Электроники МК-85С на TypeScript

### Функции
- Генерация долговременного ключа (ДКЛ)
- Поддержка буквенного и цифрового режимов
- Поддержка коррекции искажений при расшифровке 

### Установка
```bash
npm i @li0ard/angstrem3
```

### Пример
```ts
import { Cipher, Key } from "@li0ard/angstrem3";

const key = Key.fromString("84534 45986 35465 64750 69746 75562 96281 96471 16889 77629 94879 96394 73073 45415 29900 39356 54944 10712 85757 23266 32131 18232");

const c = new Cipher(key)
const enc = c.encrypt("ТЕСТ")
console.log(enc) // => 38041 88931 77869 54905
console.log(c.decrypt(enc)) // => ТЕСТ
```

Большое спасибо Bs0dd, MaFrance и kaseiiro за материалы по МК-85 и алгоритму

## ENG:

Implementation of the Angstrem-3 algorithm for Elektronika MK-85C in TypeScript

### Features
- Support for long-term key generation
- Support for alphanumeric and numeric modes
- Support for distortion correction during decryption

### Install
```bash
npm i @li0ard/angstrem3
```

### Example
```ts
import { Cipher, Key } from "@li0ard/angstrem3";

const key = Key.fromString("84534 45986 35465 64750 69746 75562 96281 96471 16889 77629 94879 96394 73073 45415 29900 39356 54944 10712 85757 23266 32131 18232");

const c = new Cipher(key)
const enc = c.encrypt("ТЕСТ")
console.log(enc) // => 38041 88931 77869 54905
console.log(c.decrypt(enc)) // => ТЕСТ
```

Thanks to Bs0dd, MaFrance and kaseiiro for materials on MK-85 and algorithm
npm package: @li0ard/bash
Description: Bash (STB 34.101.77) hash function in pure TypeScript
Author: li0ard
Latest version: 0.1.2

<p align="center">
    <b>@li0ard/bash</b><br>
    <b>Bash (STB 34.101.77) hash function in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/bash">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/bash/actions/workflows/test.yml"><img src="https://github.com/li0ard/bash/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/bash/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/bash" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/bash"><img src="https://img.shields.io/npm/v/@li0ard/bash" /></a>
    <a href="https://jsr.io/@li0ard/bash"><img src="https://jsr.io/badges/@li0ard/bash" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/bash

# from JSR
bunx jsr i @li0ard/bash
```

## Supported modes
- [x] BASH.HASH128 (256 bit)
- [x] BASH.HASH192 (384 bit)
- [x] BASH.HASH256 (512 bit)
- [x] Programmable automatons (bash-prg)

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [STB 34.101.77-2020 (in Russian)](https://apmi.bsu.by/assets/files/std/bash-spec24.pdf) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples

```ts
import { Bash } from "@li0ard/bash"

let hash = new Bash(32)
hash.update(new TextEncoder().encode("hello world"))
console.log(hash.digest())

// -- OR --

import { bash256 } from "@li0ard/bash"

console.log(bash256(new TextEncoder().encode("hello world")))
```
npm package: @li0ard/belt
Description: BelT (STB 34.101.31) cipher implementation in pure TypeScript
Author: li0ard
Latest version: 0.1.4

<p align="center">
    <b>@li0ard/belt</b><br>
    <b>BelT (STB 34.101.31) cipher implementation in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/belt">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/belt/actions/workflows/test.yml"><img src="https://github.com/li0ard/belt/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/belt/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/belt" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/belt"><img src="https://img.shields.io/npm/v/@li0ard/belt" /></a>
    <a href="https://jsr.io/@li0ard/belt"><img src="https://jsr.io/badges/@li0ard/belt" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/belt

# from JSR
bunx jsr i @li0ard/belt
```

## Supported modes
- [x] Electronic Codebook (ECB)
- [x] Cipher Block Chaining (CBC)
- [x] Counter (CTR)
- [x] Cipher Feedback (CFB)
- [x] Message Authentication Code (MAC)
- [x] Key wrapping (KWP)
- [x] Ctr-Hash-Encrypt (CHE / AEAD)
- [x] Datawrap (DWP / AEAD)
- [x] Compress function
- [x] Key expand function
- [x] Key transform function (KRP)
- [x] Blockwise disk encryption (BDE)
- [x] Sectorwise disk encryption (SDE)
- [x] Hash function (HASH)
- [x] Wide block (WBL)

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [STB 34.101.31 (in Russian)](https://apmi.bsu.by/assets/files/std/belt-spec372.pdf) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
### ECB mode
```ts
import { encryptECB, decryptECB } from "@li0ard/belt";

let key = hexToBytes("E9DEE72C8F0C0FA62DDB49F46F73964706075316ED247A3739CBA38303A98BF6");
let pt = hexToBytes("b194bac80a08f53b366d008e584a5de48504fa9d1bb6c7ac252e72c202fdce0d5be3d61217b96181fe6786ad716b890b");
let ct = hexToBytes("69cca1c93557c9e3d66bc3e0fa88fa6e5f23102ef109710775017f73806da9dc46fb2ed2ce771f26dcb5e5d1569f9ab0");

console.log(encryptECB(key, pt));
console.log(decryptECB(key, ct));
```

### CBC mode
```ts
import { encryptCBC, decryptCBC } from "@li0ard/belt";

let key = hexToBytes("E9DEE72C8F0C0FA62DDB49F46F73964706075316ED247A3739CBA38303A98BF6");
let iv = hexToBytes("BE32971343FC9A48A02A885F194B09A1");
let pt = hexToBytes("b194bac80a08f53b366d008e584a5de48504fa9d1bb6c7ac252e72c202fdce0d5be3d61217b96181fe6786ad716b890b");
let ct = hexToBytes("69cca1c93557c9e3d66bc3e0fa88fa6e5f23102ef109710775017f73806da9dc46fb2ed2ce771f26dcb5e5d1569f9ab0");

console.log(encryptCBC(key, pt, iv));
console.log(decryptCBC(key, ct, iv));
```
npm package: @li0ard/bign
Description: Bign (STB 34.101.45) curves and DSA in pure TypeScript
Author: li0ard
Latest version: 0.1.1

<p align="center">
    <b>@li0ard/bign</b><br>
    <b>Bign (STB 34.101.45) curves and DSA in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/bign">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/bign/actions/workflows/test.yml"><img src="https://github.com/li0ard/bign/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/bign/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/bign" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/bign"><img src="https://img.shields.io/npm/v/@li0ard/bign" /></a>
    <a href="https://jsr.io/@li0ard/bign"><img src="https://jsr.io/badges/@li0ard/bign" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/bign

# from JSR
bunx jsr i @li0ard/bign
```

## Supported modes:
- [x] DSA (standard curves included)

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [STB 34.101.45 (in Russian)](https://apmi.bsu.by/assets/files/std/bign-spec295.pdf) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
### Create signature (Deterministic)

```ts
import { BIGN128, sign, verify, getPublicKey } from "@li0ard/bign";

let curve = BIGN128;
let privKey = hexToBytes("1F66B5B84B7339674533F0329C74F21834281FED0732429E0C79235FC273E269");
let publicKey = getPublicKey(curve, privKey);
let digest = hexToBytes("ABEF9725D4C5A83597A367D14494CC2542F20F659DDFECC961A3EC550CBA8C75");

let signature = sign(curve, privKey, digest);
console.log(signature); // -> Uint8Array [...]
console.log(verify(curve, publicKey, digest, signature)); // -> true
```

### Create signature (Default)

```ts
import { SignMode, BIGN128, sign, verify, getPublicKey } from "@li0ard/bign";

let curve = BIGN128;
let privKey = hexToBytes("1F66B5B84B7339674533F0329C74F21834281FED0732429E0C79235FC273E269");
let publicKey = getPublicKey(curve, privKey);
let digest = hexToBytes("ABEF9725D4C5A83597A367D14494CC2542F20F659DDFECC961A3EC550CBA8C75");

let signature = sign(curve, privKey, digest, { mode: SignMode.DEFAULT });
console.log(signature); // -> Uint8Array [...]
console.log(verify(curve, publicKey, digest, signature)); // -> true
```
npm package: @li0ard/blowfish
Description: Blowfish cipher implementation in pure TypeScript
Author: li0ard
Latest version: 0.1.0

<p align="center">
    <b>@li0ard/blowfish</b><br>
    <b>Blowfish cipher implementation in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/blowfish">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/blowfish/actions/workflows/test.yml"><img src="https://github.com/li0ard/blowfish/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/blowfish/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/blowfish" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/blowfish"><img src="https://img.shields.io/npm/v/@li0ard/blowfish" /></a>
    <a href="https://jsr.io/@li0ard/blowfish"><img src="https://jsr.io/badges/@li0ard/blowfish" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/blowfish

# from JSR
bunx jsr i @li0ard/blowfish
```

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [FIPS 46-3](https://csrc.nist.gov/files/pubs/fips/46-3/final/docs/fips46-3.pdf) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
```ts
import { Blowfish } from "@li0ard/blowfish";

const cipher = new Blowfish(new Uint8Array(8));
const encrypted = cipher.encrypt(new Uint8Array(8));
console.log(encrypted); // Uint8Array [ ... ]

const decrypted = cipher.decrypt(encrypted);
console.log(decrypted); // Uint8Array [ ... ]
```
npm package: @li0ard/crapto1_ts
Description: Crapto1 TypeScript implement
Author: li0ard
Latest version: 0.3.2

<p align="center">
    <a href="https://github.com/li0ard/crapto1_ts/">
        <img src="https://raw.githubusercontent.com/li0ard/crapto1_ts/main/.github/logo.png" alt="crapto1_ts logo" title="crapto1_ts" width="120" /><br>
    </a><br>
    <b>crapto1_ts</b><br>
    <b>Recovery keys for MIFARE Classic</b>
    <br>
    <a href="https://li0ard.is-cool.dev/crapto1_ts">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/crapto1_ts/actions/workflows/test.yml"><img src="https://github.com/li0ard/crapto1_ts/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/crapto1_ts/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/crapto1_ts" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/crapto1_ts"><img src="https://img.shields.io/npm/v/@li0ard/crapto1_ts" /></a>
    <a href="https://jsr.io/@li0ard/crapto1-ts"><img src="https://jsr.io/badges/@li0ard/crapto1-ts" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/crapto1_ts

# from JSR
bunx i jsr install @li0ard/crapto1-ts
```

## Usage

> [!TIP]
> Ported mfkey64 and mfkey32 are placed [here](https://github.com/li0ard/crapto1_ts/tree/main/examples)

### Recovery by 2 sets of 32 bit auth
```ts
import { recovery32 } from "@li0ard/crapto1_ts" // or @li0ard/crapto1-ts

console.log(recovery32(
    uid,
    tagChallenge,
    readerChallenge,
    readerResponse,
    tagChallenge2,
    readerChallenge2,
    readerResponse2
).toString(16))
```

### Recovery by 1 set of full 64 bit auth
```ts
import { recovery64 } from "@li0ard/crapto1_ts" // or @li0ard/crapto1-ts

console.log(recovery64(
    uid,
    tagChallenge,
    readerChallenge,
    readerResponse,
    tagResponse
).toString(16))
```

### Recovery by Nested auth
```ts
import { recoveryNested } from "@li0ard/crapto1_ts" // or @li0ard/crapto1-ts

console.log(recoveryNested(
    uid,
    tagChallenge,
    encryptedTagChallenge,
    readerChallenge,
    readerResponse
).toString(16))
```

## Acknowledgements

Some parts were based on or greatly inspired by these projects:

- [crapto1](https://github.com/li0ard/crapto1) - Original version in C
- [Crapto1Sharp](https://github.com/kgamecarter/Crapto1Sharp) - Version in C#
- [mfkey32nested](https://github.com/RfidResearchGroup/proxmark3/blob/master/tools/mfc/card_reader/mfkey32nested.c) - Recovery by nested auth (by @doegox)
npm package: @li0ard/des
Description: DES cipher implementation in pure TypeScript
Author: li0ard
Latest version: 0.1.1

<p align="center">
    <b>@li0ard/des</b><br>
    <b>DES cipher implementation in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/des">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/des/actions/workflows/test.yml"><img src="https://github.com/li0ard/des/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/des/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/des" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/des"><img src="https://img.shields.io/npm/v/@li0ard/des" /></a>
    <a href="https://jsr.io/@li0ard/des"><img src="https://jsr.io/badges/@li0ard/des" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/des

# from JSR
bunx jsr i @li0ard/des
```

## Supported algorithms
- [x] Classic DES
- [x] 3DES-EDE

## Supported modes
- [x] Electronic Codebook (ECB)
- [x] Cipher Block Chaining (CBC)
- [x] Cipher Feedback (CFB)
- [x] Counter (CTR)
- [x] Output Feedback (OFB)
- [x] Retail MAC (ISO/IEC 9797-1 Algorithm 3)

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [FIPS 46-3](https://csrc.nist.gov/files/pubs/fips/46-3/final/docs/fips46-3.pdf) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
### ECB mode
```ts
import { decryptECB, encryptECB } from "@li0ard/des";

const key = Buffer.from("1122334455667788", "hex");
const plaintext = Buffer.from("11223344556677881122334455667788", "hex");
const encrypted = encryptECB(key, plaintext);
console.log(encrypted); // Uint8Array [ ... ]

const decrypted = decryptECB(key, encrypted);
console.log(decrypted); // Uint8Array [ ... ]
```

### ECB mode (3DES-EDE)
```ts
import { decryptECB, encryptECB } from "@li0ard/des";

const key = Buffer.from("1122334455667788...1122334455667788", "hex");
const plaintext = Buffer.from("11223344556677881122334455667788", "hex");
const encrypted = encryptECB(key, plaintext, true);
console.log(encrypted); // Uint8Array [ ... ]

const decrypted = decryptECB(key, encrypted, true);
console.log(decrypted); // Uint8Array [ ... ]
```
npm package: @li0ard/gost341194
Description: GOST R 34.11-94 hash function in pure TypeScript
Author: li0ard
Latest version: 0.1.5

<p align="center">
    <b>@li0ard/gost341194</b><br>
    <b>GOST R 34.11-94 hash function in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/gost341194">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/gost341194/actions/workflows/test.yml"><img src="https://github.com/li0ard/gost341194/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/gost341194/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/gost341194" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/gost341194"><img src="https://img.shields.io/npm/v/@li0ard/gost341194" /></a>
    <a href="https://jsr.io/@li0ard/gost341194"><img src="https://jsr.io/badges/@li0ard/gost341194" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/gost341194

# from JSR
bunx jsr i @li0ard/gost341194
```

## Supported modes
- [x] Hash function
- [x] PBKDF2

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [GOST R 34.11-94 (RFC 5831)](https://datatracker.ietf.org/doc/html/rfc5831) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples

```ts
import { Gost341194 } from "@li0ard/streebog"

let hash = new Gost341194()
hash.update(new TextEncoder().encode("hello world"))
console.log(hash.digest())
```
npm package: @li0ard/gost3413
Description: Cipher modes and padding's according to GOST R 34.13-2015 in pure TypeScript
Author: li0ard
Latest version: 0.1.7

<p align="center">
    <b>@li0ard/gost3413</b><br>
    <b>Cipher modes and padding's according to GOST R 34.13-2015 in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/gost3413">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/gost3413/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/gost3413" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/gost3413"><img src="https://img.shields.io/npm/v/@li0ard/gost3413" /></a>
    <a href="https://jsr.io/@li0ard/gost3413"><img src="https://jsr.io/badges/@li0ard/gost3413" /></a>
    <br>
    <hr>
</p>

> [!WARNING]
> This module contains only wrappers for encryption modes without reference to a specific cipher

## Installation

```bash
# from NPM
npm i @li0ard/gost3413

# from JSR
bunx jsr i @li0ard/gost3413
```

## Supported modes
- [x] Electronic Codebook (ECB)
- [x] Cipher Block Chaining (CBC)
- [x] Cipher Feedback (CFB)
- [x] Counter (CTR)
- [x] Output Feedback (OFB)
- [x] MAC (CMAC/OMAC)
- [x] Counter with Advance Cryptographic Prolongation of Key Material (CTR-ACPKM)
- [x] MAC with Advance Cryptographic Prolongation of Key Material (OMAC-ACPKM)
- [x] Multilinear Galois Mode (MGM)
- [x] KExp15/KImp15
- [x] Padding method #1 (`Процедура 1`/`Procedure 1`)
- [x] Padding method #2 (`Процедура 2`/`Procedure 2`/`ISO/IEC 7816-4`)
- [x] Padding method #3 (`Процедура 3`/`Procedure 3`)

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [GOST R 34.13-2015 (in Russian)](https://tc26.ru/standard/gost/GOST_R_3413-2015.pdf) standard
- Supports Bun, Node.js, Deno, Browsers
npm package: @li0ard/gostcurves
Description: GOST R 34.10 curves and DSA in pure TypeScript
Author: li0ard
Latest version: 0.1.5

<p align="center">
    <b>@li0ard/gostcurves</b><br>
    <b>GOST R 34.10 curves and DSA in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/gostcurves">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/gostcurves/actions/workflows/test.yml"><img src="https://github.com/li0ard/gostcurves/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/gostcurves/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/gostcurves" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/gostcurves"><img src="https://img.shields.io/npm/v/@li0ard/gostcurves" /></a>
    <a href="https://jsr.io/@li0ard/gostcurves"><img src="https://jsr.io/badges/@li0ard/gostcurves" /></a>
    <br>
    <hr>
</p>

> [!WARNING]
> This library is currently in alpha stage: the lib is not very stable yet, and there may be a lot of bugs
> feel free to try it out, though, any feedback is appreciated!

## Installation

```bash
# from NPM
npm i @li0ard/gostcurves

# from JSR
bunx jsr i @li0ard/gostcurves
```

## Supported modes:
- [x] DSA (various curves included)
- [x] VKO key agreement function
- [x] Points conversion from Weierstrass to Twisted Edwards form and vice versa

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [GOST R 34.10-2012 (RFC 7091)](https://datatracker.ietf.org/doc/html/rfc7091) and [GOST R 34.10-2001 (RFC 5832)](https://datatracker.ietf.org/doc/html/rfc5832) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
### Create signature

```ts
import { ID_GOSTR3410_2012_256_PARAM_SET_A, sign, verify, getPublicKey } from "@li0ard/gostcurves";

let curve = ID_GOSTR3410_2012_256_PARAM_SET_A;
let privKey = hexToBytes("0ca68a44333dbee1daea1e80dbdd560a43215886a392472b898ed3721e1177e0");
let publicKey = getPublicKey(curve, privKey);
let digest = hexToBytes("2dfbc1b372d89a1188c09c52e0eec61fce52032ab1022e8e67ece6672b043ee5");

let signature = sign(curve, privKey, digest);
console.log(signature); // -> Uint8Array [...]
console.log(verify(curve, publicKey, digest, signature)); // -> true
```

### Create shared key with VKO algorithm
```ts
import { ID_GOSTR3410_2012_512_PARAM_SET_A, getPublicKey, kek_34102012256 } from "@li0ard/gostcurves"

let curve = ID_GOSTR3410_2012_512_PARAM_SET_A;
let ukm = hexToBytes("27c744853c60801d")

let alicePriv = hexToBytes("67b63ca4ac8d2bb32618d89296c7476dbeb9f9048496f202b1902cf2ce41dbc2f847712d960483458d4b380867f426c7ca0ff5782702dbc44ee8fc72d9ec90c9");
let bobPriv = hexToBytes("dbd09213a592da5bbfd8ed068cccccbbfbeda4feac96b9b4908591440b0714803b9eb763ef932266d4c0181a9b73eacf9013efc65ec07c888515f1b6f759c848");

let alicePub = getPublicKey(curve, alicePriv);
let bobPub = getPublicKey(curve, bobPriv);

console.log(kek_34102012256(curve, alicePriv, bobPub, ukm)) // -> c9a9a77320e2cc559ed72dce6f47e2192ccea95fa648670582c054c0ef36c221
console.log(kek_34102012256(curve, bobPriv, alicePub, ukm)) // -> c9a9a77320e2cc559ed72dce6f47e2192ccea95fa648670582c054c0ef36c221
```
npm package: @li0ard/icaopkd
Description: Helper for ICAO PKD master lists
Author: li0ard
Latest version: 0.1.0

<p align="center">
    <b>@li0ard/icaopkd</b><br>
    <b>Helper for ICAO PKD master lists</b>
    <br>
    <a href="https://li0ard.is-cool.dev/icaopkd">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/icaopkd/actions/workflows/test.yml"><img src="https://github.com/li0ard/icaopkd/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/icaopkd/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/icaopkd" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/icaopkd"><img src="https://img.shields.io/npm/v/@li0ard/icaopkd" /></a>
    <a href="https://jsr.io/@li0ard/icaopkd"><img src="https://jsr.io/badges/@li0ard/icaopkd" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/icaopkd

# from JSR
bunx jsr i @li0ard/icaopkd
```

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [ICAO 9303](https://www.icao.int/publications/pages/publication.aspx?docnum=9303) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
npm package: @li0ard/jp2
Description: Convert JPEG2000 to PNG
Author: li0ard
Latest version: 0.1.3

# @li0ard/jp2

Convert JPEG2000 to PNG

### Example

```ts
import { jp2ToPNG } from "@li0ard/jp2";

const jpeg2000 = new Uint8Array([ /* ... */]);

console.log(jp2ToPNG(jpeg2000));
```
npm package: @li0ard/kalyna
Description: Kalyna (DSTU 7624:2014) cipher implementation in pure TypeScript
Author: li0ard
Latest version: 0.1.5

<p align="center">
    <b>@li0ard/kalyna</b><br>
    <b>Kalyna (DSTU 7624:2014) cipher implementation in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/kalyna">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/kalyna/actions/workflows/test.yml"><img src="https://github.com/li0ard/kalyna/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/kalyna/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/kalyna" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/kalyna"><img src="https://img.shields.io/npm/v/@li0ard/kalyna" /></a>
    <a href="https://jsr.io/@li0ard/kalyna"><img src="https://jsr.io/badges/@li0ard/kalyna" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/kalyna

# from JSR
bunx jsr i @li0ard/kalyna
```

## Supported modes
- [x] Electronic Codebook (ECB)
- [x] Cipher Block Chaining (CBC)
- [x] Output Feedback (OFB)
- [x] Counter (CTR)
- [x] Cipher Feedback (CFB)
- [x] Cipher-based Message Authentication Code (CMAC/OMAC)
- [x] Cipher Block Chaining-Message Authentication Code (CCM)
- [x] Galois Message Authentication Code (GMAC)
- [x] Galois/Counter Mode (GCM)
- [x] Key wrapping (KW)
- [x] XEX Tweakable Block Ciphertext Stealing (XTS)

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [DSTU 7624:2014](https://online.budstandart.com/upload/documents/121/109736_2.pdf) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
### ECB mode
```ts
import { Kalyna128, encryptECB, decryptECB } from "@li0ard/kalyna";

const cipher = new Kalyna128(hexToBytes("000102030405060708090A0B0C0D0E0F"));
const ct = hexToBytes("81BF1C7D779BAC20E1C9EA39B4D2AD06");
const pt = hexToBytes("101112131415161718191A1B1C1D1E1F");

console.log(encryptECB(cipher, pt));
console.log(decryptECB(cipher, ct));
```

### CBC mode
```ts
import { Kalyna128, encryptCBC, decryptCBC } from "@li0ard/kalyna";

const cipher = new Kalyna128(hexToBytes("000102030405060708090A0B0C0D0E0F"));
const iv = hexToBytes("101112131415161718191A1B1C1D1E1F");
const ct = hexToBytes("a73625d7be994e85469a9faabcedaab6dbc5f65dd77bb35e06bd7d1d8eafc8624d6cb31ce189c82b8979f2936de9bf14");
const pt = hexToBytes("202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F");

console.log(encryptCBC(cipher, pt, iv));
console.log(decryptCBC(cipher, ct, iv));
```
npm package: @li0ard/kupyna
Description: Kupyna (DSTU 7564:2014) hash function in pure TypeScript
Author: li0ard
Latest version: 0.1.3

<p align="center">
    <b>@li0ard/kupyna</b><br>
    <b>Kupyna (DSTU 7564:2014) hash function in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/kupyna">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/kupyna/actions/workflows/test.yml"><img src="https://github.com/li0ard/kupyna/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/kupyna/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/kupyna" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/kupyna"><img src="https://img.shields.io/npm/v/@li0ard/kupyna" /></a>
    <a href="https://jsr.io/@li0ard/kupyna"><img src="https://jsr.io/badges/@li0ard/kupyna" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/kupyna

# from JSR
bunx jsr i @li0ard/kupyna
```

## Supported modes
- [x] Kupyna 48 bit
- [x] Kupyna 256 bit
- [x] Kupyna 304 bit
- [x] Kupyna 384 bit
- [x] Kupyna 512 bit
- [x] Kupyna KMAC 256 bit
- [x] Kupyna KMAC 384 bit
- [x] Kupyna KMAC 512 bit

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [DSTU 7564:2014](https://usts.kiev.ua/wp-content/uploads/2020/07/dstu-7564-2014.pdf) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
### Compute hash
```ts
import { Kupyna256 } from "@li0ard/kupyna"

let hash = new Kupyna256()
hash.update(new TextEncoder().encode("hello world"))
console.log(hash.digest())

// OR

import { kupyna256 } from "@li0ard/kupyna"

console.log(kupyna256(new TextEncoder().encode("hello world")))
```

### Compute KMAC
```ts
import { KupynaKMAC256 } from "@li0ard/kupyna"

const msg = Buffer.from("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e", "hex")
const key = Buffer.from("1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100", "hex")
let kmac = new KupynaKMAC256(key)
kmac.update(msg)
console.log(kmac.digest())
```
npm package: @li0ard/kuznyechik
Description: Kuznyechik cipher implementation in pure TypeScript
Author: li0ard
Latest version: 0.1.4

<p align="center">
    <b>@li0ard/kuznyechik</b><br>
    <b>Kuznyechik cipher implementation in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/kuznyechik">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/kuznyechik/actions/workflows/test.yml"><img src="https://github.com/li0ard/kuznyechik/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/kuznyechik/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/kuznyechik" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/kuznyechik"><img src="https://img.shields.io/npm/v/@li0ard/kuznyechik" /></a>
    <a href="https://jsr.io/@li0ard/kuznyechik"><img src="https://jsr.io/badges/@li0ard/kuznyechik" /></a>
    <br>
    <hr>
</p>

> [!WARNING]
> This library is currently in alpha stage: the lib is not very stable yet, and there may be a lot of bugs
> feel free to try it out, though, any feedback is appreciated!

## Installation

```bash
# from NPM
npm i @li0ard/kuznyechik

# from JSR
bunx jsr i @li0ard/kuznyechik
```

## Supported modes
- [x] Electronic Codebook (ECB)
- [x] Cipher Block Chaining (CBC)
- [x] Cipher Feedback (CFB)
- [x] Counter (CTR)
- [x] Output Feedback (OFB)
- [x] MAC (CMAC/OMAC)
- [x] Counter with Advance Cryptographic Prolongation of Key Material (CTR-ACPKM)
- [x] MAC with Advance Cryptographic Prolongation of Key Material (OMAC-ACPKM)
- [x] Multilinear Galois Mode (MGM)

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [GOST R 34.12-2015 (RFC 7801)](https://datatracker.ietf.org/doc/html/rfc7801) and [GOST R 34.13-2015 (in Russian)](https://tc26.ru/standard/gost/GOST_R_3413-2015.pdf) standarts
- Supports Bun, Node.js, Deno, Browsers

## Examples
### ECB mode
```ts
import { decryptECB, encryptECB } from "@li0ard/kuznyechik";

const key = Buffer.from("8899AABBCCDDEEFF0011223344556677FEDCBA98765432100123456789ABCDEF", "hex")
const plaintext = Buffer.from("1122334455667700ffeeddccbbaa9988", "hex")
const encrypted = encryptECB(key, plaintext)
console.log(encrypted) // Uint8Array [ ... ]

const decrypted = decryptECB(key, encrypted)
console.log(decrypted) // Uint8Array [ ... ]
```

### CTR-ACPKM mode
```ts
import { decryptCTR_ACPKM, encryptCTR_ACPKM } from "@li0ard/kuznyechik"

const key = Buffer.from("8899AABBCCDDEEFF0011223344556677FEDCBA98765432100123456789ABCDEF", "hex")
const iv = Buffer.from("1234567890ABCEF0", "hex")
const plaintext = Buffer.from("1122334455667700FFEEDDCCBBAA998800112233445566778899AABBCCEEFF0A112233445566778899AABBCCEEFF0A002233445566778899AABBCCEEFF0A001133445566778899AABBCCEEFF0A001122445566778899AABBCCEEFF0A001122335566778899AABBCCEEFF0A0011223344", "hex")

const encrypted = encryptCTR_ACPKM(key, plaintext, iv)
console.log(encrypted) // Uint8Array [...]

const decrypted = decryptCTR_ACPKM(key, encrypted, iv)
console.log(decrypted) // Uint8Array [...]
```
npm package: @li0ard/oms_barcode
Description: Декодер штрихкода полиса ОМС
Author: li0ard
Latest version: 0.1.0

<p align="center">
    <b>@li0ard/oms_barcode</b><br>
    <b>Декодер штрихкода полиса ОМС</b>
    <br>
    <a href="https://li0ard.is-cool.dev/oms_barcode">документация</a>
    <br><br>
    <a href="https://github.com/li0ard/oms_barcode/actions/workflows/test.yml"><img src="https://github.com/li0ard/oms_barcode/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/oms_barcode/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/oms_barcode" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/oms_barcode"><img src="https://img.shields.io/npm/v/@li0ard/oms_barcode" /></a>
    <br>
    <hr>
</p>

## Установка

```bash
npm i @li0ard/oms_barcode
```

## Использование

```ts
import { parse } from "@li0ard/oms_barcode"

let info = parse("020016E959AF0F3A6C9DB3A17503BF84E869B9C3BF39C3A175AA5341C3800000000000000000000000000000000000000000000000000000000000000283EB0000015CEA680D9CDDEF0209E9F91FFEA628328CD157144B634204BAC30F573FF2E1021BDC2A28B2DD50A2761E4CF75FFCDBFBA71EAFC548AD07D38DC82A7D674BD09A")
console.log(info) // {...}
```
npm package: @li0ard/ons
Description: Oxen Name System resolver for TypeScript
Author: li0ard
Latest version: 0.1.1

<p align="center">
    <a href="https://github.com/li0ard/ons/">
        <img src="https://habrastorage.org/webt/6d/9s/fg/6d9sfg5l7n17urszelrhkqs6zqm.png" alt="@li0ard/ons logo" title="@li0ard/ons" width="120" /><br>
    </a><br>
    <b>@li0ard/ons</b><br>
    <b>Library for working with ONS names</b>
    <br>
    <a href="https://li0ard.is-cool.dev/ons">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/ons/actions/workflows/test.yml"><img src="https://github.com/li0ard/ons/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/ons/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/ons" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/ons"><img src="https://img.shields.io/npm/v/@li0ard/ons" /></a>
    <a href="https://jsr.io/@li0ard/ons"><img src="https://jsr.io/badges/@li0ard/ons" /></a>
    <br>
    <hr>
</p>

> [!WARNING]  
> Argon2-based ONS's are deprecated since [this](https://github.com/oxen-io/session-desktop/commit/46bd4c218d71f5bcf6b7ce207bbba078f32cef7b) commit (Support for these ONS's has been removed from Session clients)

## Features
- Supports current (Blake2B) and legacy (Argon2ID) formats
- Works in browser, Cloudflare Workers and server (Node/Deno/Bun)
- Cryptographic libraries are written in pure JS (except Argon2ID)

## Installation

```bash
# from NPM
npm i @li0ard/ons

# from JSR
bunx jsr i @li0ard/ons
```

## Examples
### Resolve ONS
```ts
import { resolve,  OnsTypes } from "@li0ard/ons"

console.log(await resolve("li0ard")) // -> Session ID
console.log(await resolve("jagerman", OnsTypes.WALLET)) // -> Wallet address
console.log(await resolve("li0ard", OnsTypes.LOKINET)) // -> Lokinet address
```

### Retrieve information from blockchain
```ts
import { infoByName,  OnsTypes } from "@li0ard/ons"

console.log(await infoByName("li0ard"))
console.log(await infoByName("jagerman", OnsTypes.WALLET))
console.log(await infoByName("li0ard", OnsTypes.LOKINET))
```

### Retrieve ONS's linked to wallet
```ts
import { infoByOwners } from "@li0ard/ons"

console.log(await infoByOwners([
    "L6JasonXTGW6juHrJgsXTxXH1Jh9u94H8NQ9m4rMwz5a9SZGr2e1cXw9MqnVH6Qx5bTgL5wf7qfvHeNPdwyC63AzMixU5ad"
])) // [...]
```
npm package: @li0ard/playready
Description: PlayReady CDM implementation in pure TypeScript
Author: li0ard
Latest version: 0.1.1

<p align="center">
    <a href="https://github.com/li0ard/playready/">
        <img src="https://raw.githubusercontent.com/li0ard/playready/main/.github/logo.svg" alt="playready logo" title="playready" width="120" /><br>
    </a><br>
    <b>@li0ard/playready</b><br>
    <b>Simple PlayReady CDM implementation</b>
    <br>
    <a href="https://li0ard.is-cool.dev/playready">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/playready/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/playready" /></a>
    <a href="https://npmjs.com/package/@li0ard/playready"><img src="https://img.shields.io/npm/v/@li0ard/playready" />
    <br>
    <hr>
</p>

> [!CAUTION]
> - **Project doesn't provide encryption/signing key and group certificate for any purposes**
> - **Project doesn't condone piracy or any action against the terms of the DRM systems**
> - **Project is for study and research only. Please don't use it for commercial purposes**

## Features
- Support `.prd` deserialization
- Strictly typed API

## Installation

```bash
npm i @li0ard/playready
```

## Example

```ts
import { Device, CDM, KeyType, CipherType, PSSH } from "@li0ard/playready";

const device = Device.decode(
    Buffer.from("....", "base64"),
    Buffer.from("....", "base64"),
    Buffer.from("....", "base64")
); // Device.fromPrd(....);
const cdm = new CDM(device);

const pssh = PSSH.decode(Buffer.from("....", "base64"));
const challenge = cdm.getLicenseChallenge(pssh.decodedPayload as string);

const license = await (await fetch(`https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:2000)`, {
    headers: {
        'Content-Type': 'text/xml; charset=UTF-8'
    },
    method: "POST",
    body: challenge
})).text();

for(const key of cdm.parseLicense(license))
    console.log(`- [${KeyType[key.type]}/${CipherType[key.cipher]}] ${key.kid.toHex()}:${key.key.toHex()}`);
```

## Links

- [PlayReady](https://microsoft.com/playready/) - PlayReady by Microsoft
- [pyplayready](https://git.gay/ready-dl/pyplayready) - An Open Source Python Implementation of PlayReady CDM (greatly inspired)
npm package: @li0ard/pssh
Description: Protection System Specific Header (PSSH) encoder and decoder
Author: li0ard
Latest version: 0.1.1

<p align="center">
    <b>@li0ard/pssh</b><br>
    <b>Protection System Specific Header (PSSH) decoder and encoder</b>
    <br><br>
    <a href="https://github.com/li0ard/pssh/actions/workflows/test.yml"><img src="https://github.com/li0ard/pssh/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/pssh/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/pssh" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/pssh"><img src="https://img.shields.io/npm/v/@li0ard/pssh" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/pssh
```

## Usage

```ts
import { PSSH } from "@li0ard/pssh";

const pssh = Buffer.from("....", "base64");
const decoded = PSSH.decode(pssh);

console.log(decoded);
```
npm package: @li0ard/renderbatch
Description: Decoder and HTML builder for Blazor RenderBatch frames
Author: li0ard
Latest version: 0.1.0

# `@li0ard/renderbatch`

Decoder and HTML builder for Blazor `RenderBatch` frames

### Example

```ts
import { decodeRenderBatchToHtml } from "@li0ard/renderbatch";

const renderBatchPayload = Buffer.from("0100000001000000010000000000000000000000ff....", "hex");
console.log(decodeRenderBatchToHtml(renderBatchPayload));
```
npm package: @li0ard/session_id
Description: Pure JS library for working with Session users IDs
Author: li0ard
Latest version: 2.0.2

<div align="center">
  <p><img width="128" src="https://habrastorage.org/webt/h4/mb/wv/h4mbwvkcsflcvyxhqcsmf7zdb80.png" /></p>
  <h3>Session ID</h3>
  <p>Pure JS library for working with Session users IDs</p>
</div>
<div align="center">
  <a href="https://www.npmjs.com/package/@li0ard/session_id"><img src="https://img.shields.io/npm/v/@li0ard/session_id"></a>  <a href="https://jsr.io/@li0ard/session-id"><img src="https://jsr.io/badges/@li0ard/session-id"></a><br>
  <img src="https://img.shields.io/github/license/theinfinityway/session_id"> 
  <a href="https://github.com/theinfinityway/session_id/actions/workflows/test.yml"><img src="https://github.com/theinfinityway/session_id/actions/workflows/test.yml/badge.svg"></a>
</div>
<hr />

## Installation

```bash
# from NPM
npm i @li0ard/session_id

# from JSR
bunx jsr i @li0ard/session-id
```

## Examples
### Convert to Ed25519
```ts
import { convertToEd25519Key } from "@li0ard/session_id"

let id = "d871fc80ca007eed9b2f4df72853e2a2d5465a92fcb1889fb5c84aa2833b3b40"
console.log(convertToEd25519Key(id))
```

### Generate blinded id (legacy format) from Session ID
```ts
import { generateBlindedId15 } from "@li0ard/session_id"

let id = "d871fc80ca007eed9b2f4df72853e2a2d5465a92fcb1889fb5c84aa2833b3b40"
console.log(generateBlindedId15(id))
```

### Unblind blinded id in legacy format
```ts
import { unblind15 } from "@li0ard/session_id"

let id = "264c132e2e72a9c50b7a981eac11a48b3e51ae5a0ea45ea47deb519a3fa76612"
let pk = "ac9c872e525a58970df6971655abb944a30b38853442a793b29843d20795e840"
console.log(unblind15(id, pk))
```
npm package: @li0ard/ssh
Description: SSH keys toolkit
Author: li0ard
Latest version: 0.1.0

<p align="center">
    <b>@li0ard/ssh</b><br>
    <b>SSH keys toolkit</b>
    <br>
    <a href="https://li0ard.is-cool.dev/ssh">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/ssh/actions/workflows/test.yml"><img src="https://github.com/li0ard/ssh/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/ssh/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/ssh" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/ssh"><img src="https://img.shields.io/npm/v/@li0ard/ssh" /></a>
    <a href="https://jsr.io/@li0ard/ssh"><img src="https://jsr.io/badges/@li0ard/ssh" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/ssh

# from JSR
bunx jsr i @li0ard/ssh
```

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Supports Bun, Node.js, Deno, Browsers
- Works with ED25519 and ECDSA keys (including password-encrypted keys)
- Supports conversion to Age format

## Examples
```ts
import { PrivateKey, PublicKey } from "@li0ard/ssh";

const privateKey = PrivateKey.parse("-----BEGIN OPENSSH PRIVATE KEY...", "yourcoolpasshprase");
const publicKey = PublicKey.parse("ssh-ed25519...");

const data = new Uint8Array([0xAA, 0xBB, 0xCC, 0xDD]);
const signature = privateKey.sign(data);

console.log(signature); // -> Uint8Array [...]
console.log(publicKey.verify(data, signature)); // -> true
```

## Acknowledgements

- [@peculiar/ssh](https://github.com/PeculiarVentures/ssh/) - Original implementation and inspiration
npm package: @li0ard/streebog
Description: Streebog hash function in pure TypeScript
Author: li0ard
Latest version: 0.2.5

<p align="center">
    <b>@li0ard/streebog</b><br>
    <b>Streebog hash function in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/streebog">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/streebog/actions/workflows/test.yml"><img src="https://github.com/li0ard/streebog/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/streebog/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/streebog" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/streebog"><img src="https://img.shields.io/npm/v/@li0ard/streebog" /></a>
    <a href="https://jsr.io/@li0ard/streebog"><img src="https://jsr.io/badges/@li0ard/streebog" /></a>
    <br>
    <hr>
</p>

> [!WARNING]
> This library is currently in alpha stage: the lib is not very stable yet, and there may be a lot of bugs
> feel free to try it out, though, any feedback is appreciated!

## Installation

```bash
# from NPM
npm i @li0ard/streebog

# from JSR
bunx jsr i @li0ard/streebog
```

## Supported modes
- [x] Hash function
- [x] PBKDF2 (for 512 bit)
- [x] HMAC (256/512 bit)
- [x] `KDF_GOSTR3411_2012_256` and `KDF_TREE_GOSTR3411_2012_256`

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [GOST R 34.11-2012 (RFC 6986)](https://datatracker.ietf.org/doc/html/rfc6986) standards
- Supports Bun, Node.js, Deno, Browsers

## Examples
### Streebog 256 bit (aka GOST R 34.11-2012 256 bit)
```ts
import { streebog256 } from "@li0ard/streebog"

console.log(streebog256(new TextEncoder().encode("hello world")))

// OR

import { Streebog256 } from "@li0ard/streebog"

const hash = new Streebog256()
hash.update(new TextEncoder().encode("hello world"))
console.log(hash.digest())
```

### Streebog 512 bit (aka GOST R 34.11-2012 512 bit)
```ts
import { streebog512 } from "@li0ard/streebog"

console.log(streebog512(new TextEncoder().encode("hello world")))

// OR

import { Streebog512 } from "@li0ard/streebog"

const hash = new Streebog512()
hash.update(new TextEncoder().encode("hello world"))
console.log(hash.digest())
```
npm package: @li0ard/strumok
Description: Strumok (DSTU 8845:2019) cipher implementation in pure TypeScript
Author: li0ard
Latest version: 0.1.1

<p align="center">
    <b>@li0ard/strumok</b><br>
    <b>Strumok (DSTU 8845:2019) cipher implementation in pure TypeScript</b>
    <br>
    <a href="https://li0ard.is-cool.dev/strumok">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/strumok/actions/workflows/test.yml"><img src="https://github.com/li0ard/strumok/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/strumok/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/strumok" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/strumok"><img src="https://img.shields.io/npm/v/@li0ard/strumok" /></a>
    <a href="https://jsr.io/@li0ard/strumok"><img src="https://jsr.io/badges/@li0ard/strumok" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/strumok

# from JSR
bunx jsr i @li0ard/strumok
```

## Supported modes
- [x] Strumok-256
- [x] Strumok-512

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with DSTU 8845:2019 standard
- Supports Bun, Node.js, Deno, Browsers

## Examples
```ts
import { Strumok } from "@li0ard/kupyna"

const key = new Uint8Array(64).fill(0xaa)
const iv = new Uint8Array(32).fill(0xbb)
const data = new Uint8Array(256).fill(0xcc);

const cipher = new Strumok(key, iv);
console.log(cipher.crypt(data)) // Uint8Array [...]
```
npm package: @li0ard/tinytlv
Description: Tiny TLV decoder and encoder
Author: li0ard
Latest version: 0.1.1

<p align="center">
    <b>tinytlv</b><br>
    <b>Tiny TLV decoder and encoder</b>
    <br>
    <a href="https://li0ard.is-cool.dev/tinytlv">docs</a>
    <br><br>
    <a href="https://github.com/li0ard/tinytlv/actions/workflows/test.yml"><img src="https://github.com/li0ard/tinytlv/actions/workflows/test.yml/badge.svg" /></a>
    <a href="https://github.com/li0ard/tinytlv/blob/main/LICENSE"><img src="https://img.shields.io/github/license/li0ard/tinytlv" /></a>
    <br>
    <a href="https://npmjs.com/package/@li0ard/tinytlv"><img src="https://img.shields.io/npm/v/@li0ard/tinytlv" /></a>
    <a href="https://jsr.io/@li0ard/tinytlv"><img src="https://jsr.io/badges/@li0ard/tinytlv" /></a>
    <br>
    <hr>
</p>

## Installation

```bash
# from NPM
npm i @li0ard/tinytlv

# from JSR
bunx i jsr install @li0ard/tinytlv
```

## Usage

```ts
import { TLV } from "@li0ard/tinytlv"

let tlv = TLV.parse("770E8202580094080801010010010301")
console.log(tlv.tag) // 77
console.log(tlv.length) // 14
console.log(tlv.value) // 8202580094080801010010010301
console.log(tlv.toString()) // 770E8202580094080801010010010301
```