explaingit

pine-org/thornwood

13RustAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

Thornwood is a Rust cryptography library with zero C code, offering hashing, encryption, signatures, and TLS support that's fully auditable. Works in Rust apps and WebAssembly (browsers/Node.js). Pre-production: wait for security audit before using in production.

Mindmap

mindmap
  root((Thornwood))
    Hashing
      SHA-2 SHA-3
      BLAKE2b
    Encryption
      AES-GCM
      Argon2id passwords
    Key Exchange
      X25519
      ECDH
    Signatures
      Ed25519 ECDSA
      RSA
    TLS Integration
      rustls plugin
      TLS 1.2 and 1.3
    WebAssembly
      Browser support
      Node.js support
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add TLS to a Rust app with no C code in the cryptography layer, keeping the whole codebase auditable.

USE CASE 2

Use hashing, encryption, or signatures from TypeScript or JavaScript via WebAssembly in the browser or Node.js.

USE CASE 3

Implement secure password authentication (OPAQUE) so plaintext passwords never reach your server.

USE CASE 4

Build a post-quantum-ready Rust service using ML-KEM-768 key encapsulation.

Tech stack

RustWebAssemblyrustlsAES-GCMEd25519ML-KEM-768OPAQUESHA-3

Getting it running

Difficulty · moderate Time to first run · 30min

Not yet on crates.io, must add via git dependency. Pre-1.0 (v0.1.7), README warns against production use until an independent security audit is complete.

Apache 2.0, free to use, modify, and distribute, even in commercial projects. Just keep the copyright notice.

In plain English

Thornwood is a Rust cryptography library built around one specific goal: a completely C-free build. Most production cryptography libraries (OpenSSL, ring, aws-lc-rs) include C code, which makes them harder to audit and verify. Thornwood implements all its cryptographic operations in Rust, with only a narrow exception for one crate that wraps verified low-level assembly routines. The rest of the code is pure Rust with no unsafe blocks. The library covers a wide range of cryptographic operations: hashing (SHA-2, SHA-3, BLAKE2b), encryption (AES-GCM), key exchange (X25519, ECDH), digital signatures (Ed25519, ECDSA, RSA), password hashing (Argon2id), and post-quantum key encapsulation (ML-KEM-768). It also implements OPAQUE, a protocol for password authentication that avoids sending the password to the server. All of these are available together through a top-level umbrella crate. The primary integration target is rustls, a TLS library written in Rust. Thornwood ships a CryptoProvider plugin for rustls that lets you run TLS 1.2 and TLS 1.3 connections without any C code in the cryptography layer. This is the main reason someone would reach for Thornwood today: they want TLS in a Rust application and want the entire compiled dependency graph to be C-free and auditable down to the primitive level. Thornwood also compiles to WebAssembly, so TypeScript or JavaScript code running in Node.js or browsers can use its hashing, encryption, key exchange, and signature operations through generated wasm packages. The project is pre-1.0 at version 0.1.7 and has not yet been published to crates.io. The README explicitly advises treating it as pre-production until an independent security audit is complete. It is maintained by Pine and licensed under Apache 2.0.

Copy-paste prompts

Prompt 1
I'm adding Thornwood as a CryptoProvider for rustls in my Rust app. Show me the minimal setup to open a TLS 1.3 client connection with no C dependencies.
Prompt 2
Using Thornwood's WASM package in a Node.js project, show me how to hash a string with SHA-256 and sign a message with Ed25519.
Prompt 3
Explain how to use Thornwood's OPAQUE implementation to register a user and authenticate them without the password ever leaving the client.
Prompt 4
Show me how to do AES-GCM encryption and decryption in Rust using Thornwood, including how to handle the nonce safely.
Prompt 5
What are the steps to add Thornwood's ML-KEM-768 key encapsulation to an existing Rust service for post-quantum readiness?
Open on GitHub → Explain another repo

← pine-org on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.