A lightweight, secure-capable archiver utilizing LZ77 compression and modern authenticated encryption (AEAD). Now featuring WebAssembly support for secure, in-browser video streaming.
- Algorithm: Tunable LZ77 (Greedy/Lazy matching) + Huffman-style coding.
- Format: QQX5 (Streaming-friendly, chunk-based).
- Web-Ready: Compiles to WASM for high-performance (500MB/s+) in-browser decryption.
- Security:
- Cipher: XChaCha20-Poly1305 (via Monocypher).
- KDF: Argon2id (Memory-hard key derivation).
- Model: Insecure by default (for convenience) with Smart Decryption.
- Integrity: Full cryptographic authentication of headers and data.
Kyu uses a simple Makefile and requires a C99 compiler. It relies on monocypher for cryptography, which is automatically fetched via scripts/vendor.sh.
# 1. Build optimized release binary (CLI tool)
make
# 2. Build WebAssembly Library & Demo
make wasm
# 3. Generate Documentation (Doxygen)
make docsBasic (Insecure Mode) By default, Kyu uses a hardcoded default password. This is convenient for non-sensitive data.
# Compress
./kyu -c -o video.kyu ./my_video.mp4
# Decompress
./kyu -d video.kyuSecure Mode
To encrypt your data securely, use -p.
# Encrypt
./kyu -c -p -o secret.kyu ./sensitive.data
# Decrypt (Auto-detects encryption)
./kyu -d secret.kyuKyu includes a high-performance browser demo that can decrypt and stream 4K video in real-time using WebAssembly and the Streams API.
- Build the WASM target:
make wasm
- Launch the Live Server:
./scripts/rebuild_live.sh go
- Test:
Open
http://localhost:8080and drag-and-drop a.kyuencrypted video file. It will decrypt and play instantly without downloading the full file to memory.
The archive consists of a sequence of chunks. Each chunk is individually encrypted and authenticated, allowing for random access and streaming.
- Header:
KYU5+Salt(16 bytes). - Packet (V2):
- Header: Sequence ID (8 bytes) + Length/Flags (8 bytes).
- MAC: 16 bytes (Poly1305).
- Payload: Encrypted/Compressed data (XChaCha20).
- Manifest: Encrypted metadata (filename, permissions, mtime) at the end of the stream.
src/: Core C implementation and TypeScript wrappers.include/: Public API headers.scripts/: Build helpers, benchmarks, and test runners.
BSD-2-Clause / CC0 (Dual Licensed).