dorado・鱰
Educational · Unaudited · Built from scratch

dorado

Threefish, built from scratch.

The tweakable block cipher at the heart of the Skein hash function, all three sizes, with a small and honest tool stack on top: counter mode, an authenticated streaming password container, and a Skein hashing tool. One cipher and one file format, implemented nine ways: Rust, Go, C, C++, Zig, Java, Python, Haskell, and TypeScript (which also runs in your browser). Each reimplements the primitives from scratch; the shipping TypeScript CLIs and the browser demo run the verified Rust cipher compiled to WASM.

All platforms and downloads · read the docs

dorado's encrypt view in the Dracula theme: a password and the message 'The quick brown fox jumps over the lazy dog.' entered, with the resulting ciphertext hex shown under Output dorado's encrypt view in the Solarized Light theme: a password and the message 'The quick brown fox jumps over the lazy dog.' entered, with the resulting ciphertext hex shown under Output gyotaku's hash view in the Dracula theme: a message entered with the 256-bit Skein-512 output length selected, ready to compute the digest gyotaku's hash view in the Solarized Light theme: a message entered with the 256-bit Skein-512 output length selected, ready to compute the digest

Three tools, one cipher

The project is the cipher plus a few tools that read one shared file format. The command-line tool and the hasher are ported across languages; the desktop app is the one Rust-only frontend.

dorado encrypt / decrypt

The cipher tool: encrypt and decrypt files or stdin, with a password-derived authenticated container or a caller-supplied raw key. Both paths authenticate by default (raw mode's bare CTR remains an explicit opt-out). The command-line interface is ported to eight languages plus the in-browser demo, all reading the same files.

Rust · Go · C · C++ · Zig · Python · Haskell · TypeScript · browser

gyotaku hashing

A standalone Skein-512 hashing tool, like sha256sum but Skein. Kept separate from the cipher tools so a hash needs no key stack. Named for the Japanese art of fish-printing: a fingerprint of a file.

Rust · Go · C · C++ · Zig · Python · Haskell · TypeScript · browser

dorado-gui · gyotaku-gui desktop apps

Both tools in a native window, built with iced and sharing one look: a password encrypt/decrypt app and a Skein-512 hashing app. Key derivation and hashing run off the UI thread. The desktop frontends are Rust-only.

Rust

Try it in your browser

Both tools, entirely client-side, over the verified Rust core compiled to WebAssembly. Nothing leaves your browser.

Encrypt and decrypt

Encrypt a message to a password container and decrypt it back. The container is the same one the CLIs read, so this output decrypts with dorado decrypt and vice versa.

Hash

Skein-512 hash a message at a chosen output length, the gyotaku tool in the browser. The digest matches gyotaku for the same input.

How it works

Each layer is a thin step above the one below. The cipher is the foundation; everything else is standard machinery wrapped around it.

Threefish is the algorithm. A keyed, reversible scramble of one fixed-size block, with a non-secret tweak. Verified against official test vectors.
CTR is a mode. A generic recipe that wraps the cipher to handle any length. It only calls the cipher and holds no cipher internals.
The tools add the rest. Key derivation from a password, encrypt-then-MAC authentication, and a chunked streaming file format, so tampering, a wrong password, reordering, and truncation are all detected.

Threefish 256 · 512 · 1024

The tweakable ARX block cipher at the core of Skein, all three sizes, encrypt and decrypt, following the Skein 1.3 spec. No S-boxes, no lookup tables.

CTR mode

Turns the block cipher into any-length encryption. The same routine encrypts and decrypts; the counter is public.

Key derivation

Argon2id, scrypt, or PBKDF2-HMAC-SHA256, with cost parameters stored in the header and bounded on decrypt to refuse a hostile file.

MAC menu 3 choices

Authentication via Skein-512 (default), HMAC-SHA256, or keyed BLAKE3. Skein-512 and keyed BLAKE3 are from scratch in every implementation; HMAC-SHA256 comes from each ecosystem's standard library (Haskell and C++ build it from scratch too). All produce 32-byte tags and are bound into the header.

How we know it works

Confidence comes from several independent checks. None of this is a security claim; it is evidence that the code matches the specifications it targets.

  • Known-answer tests against official Threefish vectors for each block size.
  • Differential testing against the RustCrypto crates: Threefish, and the from-scratch Skein-512 and BLAKE3, over many random inputs.
  • Construction tests for round-trips, wrong passwords, tampering, truncation, and every MAC.
  • Fuzzing and #![forbid(unsafe_code)] across every crate, with a fuzz target over the decrypt parser.

One cipher, nine implementations

Dorado is written nine ways: Rust (the reference), Go, C, C++, Zig, Java (a library only), Python, Haskell, and a TypeScript port that runs both in Node and in your browser. All reimplement the same primitives from scratch, share the same on-disk format, and are byte-for-byte cross-compatible, so a file made by one opens in the others. What differs is what each runtime allows; the two TypeScript rows are the same code, only the runtime changes, and as the table shows, the TypeScript rows ship the Rust cipher compiled to WASM (the pure-TS cipher backs the test suite).

Implementation Role / frontendsCipher engineKey derivationStreamingSecret memory
Rust Reference; CLIs + 2 GUIsnativeargon2 / scrypt / pbkdf2 cratesYeszeroize wipe; CLI and dorado-gui mlock password
Go Port; CLIsnativex/crypto + stdlibYeswipes keys; mlocks password (off-heap)
C Port; CLIsnativelibargon2 + OpenSSLYeswipes keys; mlocks password
C++ Port; CLIsnativeOpenSSL EVP_KDFYeswipes keys; mlocks password
Zig Port; CLIsnativeZig stdlib (no deps)Yeswipes keys; mlocks password
Java Port; SDK onlynativeBouncy CastleYescaller-managed
Python Port; CLIsnativeargon2-cffi + hashlibYescaller-managed
Haskell Port; CLIsnativecryptonYescaller-managed
TypeScript · Node Port; CLIsWASM (Rust core)hash-wasmNo (in-memory)locked off-heap buffers (fail-closed; --insecure-memory opts out)
TypeScript · Browser In-page demoWASM (Rust core)hash-wasmNo (in-memory)none (demo)

Axes left out above: the cipher primitives build bare-metal (no OS, no allocator) in Rust, C, and Zig; only Rust documents a full constant-time discipline; and memory safety is why Rust leads overall, since it alone prevents the use-after-free and overrun bugs that can leak a secret at compile time (C and Zig match the wipe-and-lock mechanism itself; Go approximates it with an off-heap mlock'd buffer, though its wipe is a convention, not a language guarantee). Full breakdown in docs/implementations.md.

Build and run

The reference build is the Rust workspace in rust/, streaming in constant memory. The Go and TypeScript ports build the same dorado and gyotaku commands over the same files (see the comparison above).

cd rust
cargo build --release --workspace

# password-encrypt a file (authenticated)
target/release/dorado encrypt --password --in notes.txt --out notes.txt.mahi

# Skein-hash a file
target/release/gyotaku notes.txt
Honest by design. dorado is educational and unaudited. It is not described as secure, production-ready, or guaranteed constant-time. The cipher provides confidentiality only; the password container adds authentication. For real data, prefer an audited tool.