Skip to content

Commit 1175453

Browse files
committed
0.2.11: decodeData crpytit API, Readme
DataDecode: - Decode data supports analyzing data for chunk sizes, number of chunks, payload length - For text, decodeData supports auth tags and iv retrieval for the two schemes - Added 2 tests for dataDecode **Bug**: Large files data decoding leads to memory issues Update README.md Implemented CipherConstructor for static IV_LENGHT and set this constant as both cipher properties static aswell as property
1 parent fd60b91 commit 1175453

21 files changed

Lines changed: 384 additions & 165 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ node_modules/
44
build/
55
dist/bin/cryptit
66
*.tmp
7-
scan*.md
7+
scan*.md
8+
*.enc
9+
*.mp4

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# @mqxym/cryptit
22

3-
Modern, cross-platform **AES-GCM 256 / XChaCha20Poly1305 + Argon2-id** encryption for both **files** *and* **text**.
3+
Modern, cross-platform encryption for both **files** *and* **text**.
44

55
* **Node 18 / Bun 1** - native `argon2` addon + WebCrypto
66
* **Browser (evergreen)** - tiny WASM build of `argon2-browser`
77
* **CLI** - stream encryption & decryption, zero memory bloat
88
* **TypeScript-first**, tree-shakable, ESM & CJS builds
99
* **Format-agnostic decryption** - one instance reads any registered scheme
1010

11+
## Scheme Support
12+
13+
Currently there are 2 encryption schemes supported:
14+
15+
* **Scheme 0** (default): **AES-GCM 256** (native via Crypto API) and **Argon2id** (single thread parallelism setup using `argon2` or `argon2-browser`)
16+
* **Scheme 1**: **XChaCha20Poly1305** (via JavaScript engine `@noble/cipehrs`) and and **Argon2id** (multi thread parallelism setup using `argon2` or `argon2-browser`)
17+
18+
The library can support up to 8 schemes via a header info byte (3 bit allocated).
19+
1120
---
1221

1322
## Install
@@ -27,7 +36,7 @@ yarn add @mqxym/cryptit # or npm i / pnpm add
2736
```ts
2837
import { createCryptit } from "@mqxym/cryptit";
2938

30-
const crypt = createCryptit({ difficulty: "middle" });
39+
const crypt = createCryptit({ scheme: 1 });
3140
const pass = "correct horse battery staple";
3241

3342
const b64 = await crypt.encryptText("hello", pass);
@@ -89,7 +98,7 @@ await c.encryptText("txt", pass);
8998
await c.decryptText(b64, pass);
9099

91100
// runtime tweaks
92-
c.setDifficulty("high");
101+
c.setDifficulty("high"); // Argon2id difficulty preset
93102
c.setScheme(1); // choose another registered format (scheme 1 = XChaCha20Poly1305)
94103
c.setSaltDifficulty("low");
95104

dist/browser/cryptit.browser.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/browser/cryptit.browser.min.js.map

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cli/cryptit.cli.cjs

Lines changed: 35 additions & 34 deletions
Large diffs are not rendered by default.

dist/cli/cryptit.cli.cjs.map

Lines changed: 11 additions & 10 deletions
Large diffs are not rendered by default.

dist/cli/cryptit.cli.js

Lines changed: 35 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cli/cryptit.cli.js.map

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cryptit.index.cjs

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

dist/cryptit.index.cjs.map

Lines changed: 10 additions & 9 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)