Syferit Engineering Documentation
Comprehensive integration guides, compiler options, domain profiles, and CI/CD pipelines for the Syferit code defense engine.
Quickstart Guide
Syferit integrates directly into your build pipeline at compile time. In development (`mode: 'development'`), transformations are automatically bypassed to preserve hot module reloading (HMR) and source maps. When running production builds (`next build` or `vite build`), full AST logic entanglement is enforced.
npm install -D @syferit/next @syferit/vite-plugin @syferit/cliThe Post-REA Threat Model
Reverse Engineering Automation (REA) combined with frontier Large Language Models (Claude, OpenAI, Gemini) and headless Ghidra has fundamentally altered software security. Minified variables like _0x1a() and isolated boolean assertions (if (!check()) return false) are trivial for AI agents to decompile, rename, and clone within minutes.
Vulnerability: Automated AST Reconstruction
Minifiers and legacy renaming tools are bypassed effortlessly by frontier models. Contextual LLM prompts infer original function purposes, rename obfuscated symbols, and generate equivalent clean source code in seconds.
Syferit: Build-Time Invariant Entanglement
Syferit transforms control flow topology, execution graphs, and mathematical logic invariants at compilation. Automated decompilers face combinatorial state explosion and cognitive saturation without ever obtaining the original source logic.
Next.js (App Router & Pages Router)
The @syferit/next adapter wraps your Next.js configuration. It protects all client-side JavaScript chunks emitted into .next/static/chunks/ while keeping Server Components (RSC) and SSR routes completely untampered and lightning-fast.
import { withSyferit } from '@syferit/next';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
// Automatically activates during production build
export default withSyferit(nextConfig, {
domainProfile: 'saas',
preset: 'hardened',
seed: null // Auto CSPRNG seed per build
});In Next.js 15 and 16, Turbopack is the default engine for development (next dev). Because Syferit hooks deeply into the compilation asset pipeline via Webpack to harden production chunks, ensure your production build script in package.json targets "next build --webpack":
{
"scripts": {
"dev": "next dev",
"build": "next build --webpack",
"start": "next start"
}
}Development mode (next dev) remains fully accelerated by Turbopack with instant HMR, as Syferit automatically bypasses transformations in development.
Vite (React, Vue, Svelte, Astro)
The @syferit/vite-plugin hooks into the Rollup chunk generation phase during vite build.
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { syferit } from '@syferit/vite-plugin';
export default defineConfig({
plugins: [
react(),
syferit({
mode: 'production',
domainProfile: 'fintech'
})
]
});Webpack 5 & Angular Integration
The @syferit/webpack-plugin hooks into Webpack's asset emission stage. It operates on final JavaScript chunk assets, ensuring full compatibility with Webpack 5, Angular (via custom-webpack), and standalone microfrontends.
const { SyferitWebpackPlugin } = require('@syferit/webpack-plugin');
module.exports = {
mode: 'production',
plugins: [
new SyferitWebpackPlugin({
preset: 'hardened',
domainProfile: 'fintech',
include: [/\.js$/],
exclude: [/node_modules/]
})
]
};In Angular projects using @angular-builders/custom-webpack, add the plugin in your extra-webpack.config.js to protect compiled production bundles emitted into dist/browser/.
Universal CLI (@syferit/cli)
The standalone CLI operates across entire distribution folders. It automatically identifies and transforms JavaScript/TypeScript files, WebAssembly binaries (.wasm), Python modules (.py), and native C/C++/Rust source trees by file extension.
# Output protected files to a separate directory (Recommended)
npx @syferit/cli protect ./dist -o ./dist-protected --preset hardened
# Protect in-place with a domain profile
npx @syferit/cli protect ./dist -d fintech --preset maximum
# Use a deterministic build seed for reproducible CI polymorphism
npx @syferit/cli protect ./dist -s 0x4f22c19e| Flag | Type | Default | Description |
|---|---|---|---|
| [target], -t, --target | string | Required | Path to file or directory to protect (e.g. ./dist). |
| -o, --out, --output | string | In-place overwrite | Destination path for hardened output files. |
| --preset | string | hardened | Transformation intensity: standard, hardened, or maximum. |
| -d, --domain, -p, --profile | string | saas | Domain dictionary profile: saas, fintech, security, or gaming. |
| -s, --seed | string | CSPRNG UUID | Deterministic build seed for reproducible builds. |
GitHub Action CI/CD Integration
Automate code defense enforcement on every pull request or release branch. Ensure that no unprotected binary or client bundle ever touches production infrastructure.
name: Production Deploy
on:
push:
branches: [main]
jobs:
build-and-protect:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install & Build
run: |
npm ci
npm run build
- name: Syferit Code Protection Pass
run: npx @syferit/cli protect ./dist --mode production --preset hardened
- name: Deploy to Cloud
run: npm run deployWebAssembly (.wasm) Hardening
Decompilers like Wasm2c and Ghidra reconstruct function signatures, memory tables, and export interfaces from unstripped WebAssembly modules. Syferit hardens the WebAssembly glue layer, memory descriptors, and export boundaries to prevent automated API enumeration and clean-room extraction.
# Protect compiled Wasm distribution and JavaScript glue bindings (wasm-pack or Emscripten output)
npx @syferit/cli protect ./pkg --target wasm --out ./pkg-hardened --preset maximumPython 3 Source & Bytecode Protection
Python modules (.py, .pyc) are routinely decompiled in seconds using uncompyle6 or Decompyle++. Syferit's Python AST pass hardens proprietary logic trees prior to bytecode packaging or PyInstaller bundling.
# Protect Python application tree before freezing or Docker distribution
npx @syferit/cli protect ./backend/src --target python --out ./backend/build --preset hardenedNative C/C++/Rust (LLVM) Pre-Compile Pass
Before feeding C, C++, or Rust code to Clang or rustc, Syferit's pre-processor pass transforms control structures and mathematical invariants, eliminating predictable assembly patterns that Ghidra and IDA Pro rely on for automated pseudocode reconstruction.
# Transform native sources before compilation
npx @syferit/cli protect ./src-native --out ./build-protected --preset hardened
# Compile the hardened sources with standard tooling
clang++ -O3 ./build-protected/main.cpp -o ./bin/releaseElectron Desktop Application Hardening
Electron desktop apps distribute complete source code inside unpackable app.asar archives. Syferit protects both the main process (main.js) and preload scripts (preload.js), neutralizing IPC channel tampering, memory hooking, and license bypasses.
# In package.json electron-builder build pipeline:
"scripts": {
"build": "vite build && npx @syferit/cli protect ./dist --domain security --preset maximum",
"package": "npm run build && electron-builder"
}Presets & Domain Profiles
Basic logic entanglement, dynamic dispatch, and runtime integrity checks. Fastest build time.
Non-invertible algebraic gating, AST structure dissolution, and adversarial synthesis disruption. Recommended for production.
Multi-round state scrambling, aggressive anti-tamper traps, polymorphic jump matrices. Ideal for sensitive IP/fintech.
- 'saas' (Default): Injects entitlement verifications, tenant quotas, monotonic clock thresholds.
- 'fintech': Injects consensus sequence digests, transaction context verification, settlement journals.
- 'security': Injects kernel attestation rings, enclave digests, HMAC sequence frames.
- 'gaming': Injects physics tick drift checks, snapshot integrity gates, anti-speedhack lattices.
SyferitOptions Schema (TypeScript Reference)
The unified options object accepted by withSyferit (Next.js), syferit (Vite), and SyferitWebpackPlugin (Webpack 5).
export interface SyferitOptions {
/** Defense level applied to AST control flows */
preset?: 'standard' | 'hardened' | 'maximum'; // default: 'hardened'
/** Domain-tailored invariant profile */
domainProfile?: 'saas' | 'fintech' | 'security' | 'gaming'; // default: 'saas'
/** Fixed seed for reproducible builds. Pass null for CSPRNG entropy per build */
seed?: string | null; // default: null
/** Array of file patterns to include */
include?: (string | RegExp)[]; // default: [/\.m?[jt]sx?$/]
/** Array of file patterns to exclude */
exclude?: (string | RegExp)[]; // default: [/node_modules/]
/** Execution mode. 'development' automatically bypasses transforms to preserve HMR */
mode?: 'development' | 'production'; // default: process.env.NODE_ENV
/** Embed statutory trade secret attestation (18 U.S.C. § 1836) */
legalAttestation?: boolean; // default: true
/** Suppress non-critical compiler warnings */
silent?: boolean; // default: false
}| Property | Type | Default | Description |
|---|---|---|---|
| preset | 'standard' | 'hardened' | 'maximum' | 'hardened' | Selects transformation intensity. 'hardened' is recommended for production. |
| domainProfile | 'saas' | 'fintech' | 'security' | 'gaming' | 'saas' | Configures specialized domain invariants (quotas, ledgers, velocity lattices). |
| seed | string | null | null | Pass string for deterministic caching, or null to generate fresh CSPRNG entropy per build. |
| include | (string | RegExp)[] | [/\\.m?[jt]sx?$/] | Glob patterns or RegExps specifying which files or chunks to protect. |
| exclude | (string | RegExp)[] | [/node_modules/] | Patterns to exclude from transformation. Third-party dependencies are skipped by default. |
| mode | 'development' | 'production' | process.env.NODE_ENV | In 'development', Syferit automatically bypasses protection to maintain fast HMR. |
| legalAttestation | boolean | true | Embeds 18 U.S.C. § 1836 statutory trade-secret notices in chunk headers. |
FAQ & Search Engine Optimization (SEO & GEO)
Will Syferit affect my Google or Bing SEO rankings?
No. Search crawlers evaluate the rendered HTML DOM, metadata, Core Web Vitals, and server-rendered content. Syferit preserves 100% mathematical functional equivalence, leaving HTML markup, headers, and SSR content completely untouched.
What about Generative Engine Optimization (GEO) and AI Answer Engines?
AI search engines (Perplexity, ChatGPT Search, Gemini, Claude) index structured Schema.org data, clean documentation, and public copy. Syferit only protects the compiled, internal algorithms inside your JavaScript chunks—it never alters public documentation or search indexes.
How does Syferit execute in production with zero performance lag?
Syferit compiles to single-digit nanosecond bitwise operations and non-linear algebraic invariants. Benchmarked across 50,000 runs, execution penalty is under 0.08ms with zero persistent heap memory allocation.
How does Syferit resist automated algebraic constraint solvers (SMT/Z3)?
Syferit entangles conditional control paths with non-linear algebraic invariants. Because the resulting mathematical formulations lack a continuous closed-form inverse, automated solvers face exponential constraint explosion, making automated algebraic inversion computationally intractable.