Overview
Ensia (OLLVM-Next) is an LLVM-based obfuscation framework that continues the Hikari lineage with a transformation engine rebuilt for LLVM 21 and later. It targets Linux, Windows (MSVC, clang-cl, MinGW), macOS, iOS and Android, with first-class support for x86_64, AArch64 and i386.
The design rejects the virtualizer's single point of failure. There is no central interpreter to devirtualise; fifteen passes are interleaved across a twelve-stage cascade, so the output of each pass is the input of the next and an analyst has to survive the composition rather than defeat one mechanism.
Support is tiered rather than claimed uniformly: Linux and Windows on x86_64 and AArch64 are release blockers, macOS and FreeBSD follow, and the rest — OpenBSD, iOS, Android, RISC-V, i386 — is best-effort with issue response only.
Capabilities
what it doesNo single point of failure
Ensia rejects the virtualizer's central interpreter. Fifteen passes are composed so that removing one does not reveal the rest.
Chaos state machine
Control flow is replaced by a logistic-map dynamical system in Q32 fixed point, with a 2³² state space and cellular-automaton attractors.
Hardware opaque predicates
CPUID feature bits, RDTSC parity and CNTPCT_EL0 make branch conditions impossible to fold without executing them.
String and constant encryption
Vernam OTP over a Rijndael GF(2⁸) layer, decrypted by inlined stubs that zeroize on return; constants use MBA shares or Feistel mixing.
Import elimination
Function-call obfuscation resolves calls at runtime through dlopen/dlsym or GetProcAddress, so the import table stops describing the binary.
Metadata elimination
DWARF, COMDATs, llvm.ident and internal symbols are stripped or scrambled, and every function is stamped noinline optnone to survive LTO.
How it works
design notesCascade order, not a pass list
Anti-hook and anti-class-dump run first, then wrappers and call obfuscation, then the per-function loop, then a second constant-encryption phase and branch encryption. Each stage assumes the previous one already ran.
Per-function loop
Inside the loop the order is fixed: substitution, MBA, block splitting, bogus control flow, then either the chaos state machine or classic flattening, then vector lifting. Splitting before flattening is what forces MBA expressions across block boundaries.
Two-phase constant encryption
Programmer literals are encrypted before the CFG is rewritten, and the state constants produced by BCF, CSM and CFF are encrypted afterwards, so the keys themselves are not left in the clear.
Cleanup and symbol scrambling
Temporary sentinels are erased, DWARF and COMDATs are stripped, the translation-unit path is anonymised, and internal symbols are rewritten to hashed names.
Policy engine
Ordered rules match module paths and function symbols with regular expressions; the first match wins, so a hot function can be excluded while the rest of the binary is treated at full strength.
Toolchain integration
The pass plugin loads through clang's -fpass-plugin or rustc's -Z llvm-plugins. Configuration is discovered from ensia.toml, ENSIA_CONFIG or -mllvm, and presets run from low to max.
Measured expansion
project benchmarks| Domain | Mean expansion | Note |
|---|---|---|
| Post-quantum (PQC) | 5.6× | smallest footprint |
| Lightweight / AEAD | 39.0× | — |
| Block cipher | 48.2× | — |
| Hash / digest | 48.5× | — |
| Stream cipher | 50.2× | — |
| MAC / authenticator | 55.6× | — |
| KDF / password | 64.1× | — |
| Asymmetric / PKC | 103.6× | largest footprint |
Install
cargo# build the pass plugin, then load it
clang -fpass-plugin=/path/to/libEnsia.so \
-O2 main.c -o main
# pick a preset instead of a full config
ENSIA_PRESET=mid clang -fpass-plugin=/path/to/libEnsia.so \
-O2 main.c -o mainPresets run from low to max. Configuration is discovered from ./ensia.toml, ENSIA_CONFIG, or -mllvm -ensia-config. A Rust frontend plugin is available for cargo builds. Read ETHICS.md before use: this is dual-use tooling.