WarFi Labs

LORICA

layered defence in depth ยท post-quantum, from scratch, in Rust

LORICA is WarFi's paranoid encryption framework. The name is the segmented plate armor of the Roman legions, overlapping bands of iron that stopped a blow by forcing it through every layer instead of one. The software is built on the same idea. Its premise is a single uncomfortable question: what if one algorithm falls, perhaps to a quantum computer the world does not yet know exists? Its answer is mathematical diversity. Rather than trust any one primitive, LORICA layers several independent ones, drawn from different branches of mathematics, so that breaking the whole demands breaking all of them at once. It is written from scratch in Rust for auditability, and documented here in full: what it is, how it is built, how to run it, and where to get it.

01Why redundant algorithms

Most systems rest on one cipher and one key-exchange. That is efficient, and it is a single point of failure: the day the underlying problem is solved, everything protected by it is open. LORICA refuses that bet. It requires an attacker to defeat a classical block cipher, a lattice problem, a code-based problem, and a hash-based scheme simultaneously, four independent hard problems from four different fields. No single breakthrough collapses it.

» Serpent-256-CTR for symmetric encryption, the conservative AES-finalist cipher.

» Kyber / ML-KEM (lattice) and Classic McEliece (code-based) for key exchange.

» SPHINCS+ (hash-based) for signatures that rest only on the strength of a hash.

» SHA3-512 (Keccak) with HMAC and HKDF binding the layers together.

↑ contents

02The seven-layer architecture

Each layer is independent of the others, so no single break collapses the system; every layer an attacker clears still leaves the next, built on different mathematics.

Layer 7: Pre-Shared Key (information-theoretic, optional) Layer 6: SPHINCS+ hash-based signatures Layer 5: Classic McEliece code-based key exchange Layer 4: Kyber / ML-KEM lattice-based key exchange Layer 3: HKDF-SHA3-512 key derivation Layer 2: HMAC-SHA3-512 authentication Layer 1: Serpent-256-CTR symmetric encryption

03Security tiers

The tiers scale the paranoia to the threat, trading speed for margin as the stakes rise.

tier algorithms use case -------- ------------------------------- ------------------------ Standard Kyber + Serpent-256 normal sensitive data Elevated Kyber + McEliece + Serpent-256 high-value secrets Paranoid all layers + SPHINCS+ nation-state adversaries Maximum all layers + larger parameters when speed does not matter

04Implementation

LORICA is pure Rust with a single external dependency, for secure randomness. Every primitive is implemented from scratch so that each line is auditable and there is no hidden supply-chain risk, and Rust's memory safety removes a whole class of bugs that have plagued C cryptography.

» Serpent-256: full 32-round implementation with all eight S-boxes.

» SHA3-512/256: complete Keccak sponge, with HMAC (RFC 2104) and HKDF (RFC 5869).

» Post-quantum pieces (Kyber, McEliece, SPHINCS+) implemented for the reference design.

» Twelve tests covering round-trip encryption, CTR mode, and tamper detection, all passing.

LORICA's documentation is candid that a production deployment should replace the reference post-quantum pieces with a hardened library such as liboqs. Understand the design here; harden it before trusting it with anything that matters.

↑ contents

05Build, run, test

LORICA builds with a standard Rust toolchain. Clone it, build in release mode, and run the test suite to confirm the primitives behave on your machine.

$ cargo build --release

$ cargo test

$ ./target/release/lorica

running 12 tests test serpent::tests::test_encrypt_decrypt_roundtrip ... ok test serpent::tests::test_ctr_mode ... ok test sha3::tests::test_keccak ... ok test lorica::tests::test_tamper_detection ... ok ... test result: ok. 12 passed; 0 failed; 0 ignored

» Choose a security tier at run time to match the threat; Standard is the sensible default, Paranoid and Maximum trade speed for margin when the data warrants it.

↑ contents

06Changelog

LORICA follows semantic versioning. The history below is kept short and honest; roadmap items are marked as such.

v0.1.0 (initial release) + Serpent-256-CTR from scratch (32 rounds, 8 S-boxes) + SHA3-512/256 Keccak, HMAC-SHA3, HKDF-SHA3 + Kyber/ML-KEM, Classic McEliece, SPHINCS+ (reference design) + seven-layer architecture, four security tiers + 12 tests passing; 17-page technical paper; project website roadmap - swap reference PQC for liboqs in a production profile - independent cryptographic review - signed, packaged binaries for common platforms
ArtifactFormatDownload
LORICA source (Rust)git / tar.gzposting soon
Technical paperPDF, 17 ppposting soon
Release binariesLinux x86-64posting soon

Downloads are posted once each release is signed; verify the signature before running any binary, exactly as the cipher guide's verify-what-you-download section describes.

↑ contents

Authorized use only. Use these tools and techniques solely on systems you own or have explicit written permission to test. Unauthorized access to computers, networks, or data is a crime in nearly every country, including the Philippines (RA 10175), the United States (CFAA), the United Kingdom (Computer Misuse Act 1990), and across the European Union (Directive 2013/40/EU). When in doubt, get permission in writing first. This is general information, not legal advice.