DEV Community

Cover image for How We Bound 512-Bit Cryptographic Signatures to Non-Linear Sri Yantra Vector Geometry Inside Raw PDF Streams
Yaroslav Baienko
Yaroslav Baienko

Posted on Originally published at yaroslavbaienko.github.io

How We Bound 512-Bit Cryptographic Signatures to Non-Linear Sri Yantra Vector Geometry Inside Raw PDF Streams

When a PDF contract, court filing, or financial report is digitally signed with a Qualified Electronic Signature—such as European eIDAS (ETSI EN 319 142-1 PAdES-B-LTA) or Ukrainian DSTU 4145-2002—there is a fundamental disconnect between the binary cryptographic container and the visual representation of the page.

The blue "Digitally Signed" stamp you see on a PDF page is purely decorative. Anyone can copy that visual stamp into another PDF, and if a single byte of text is modified in transit, the visual stamp remains identical unless verified inside a specialized ASN.1/CMS validator. Conversely, bitmap watermarks bloat file sizes by hundreds of kilobytes and degrade under scaling.

To solve this, I built and open-sourced the Marma-Crypto Protocol (v1.3.0) (MIT License)—a deterministic cryptographic geometric watermarking specification, client-side WebAssembly/Canvas Sealer & Verifier, and Linux CLI tool that turns raw PDF vector geometry into a 256-bit bijective carrier of the document's cryptographic digest.


1. The Mathematical Core: The Impossibility Theorem & 4,096 Coupled States

Instead of ugly QR codes or raster noise, we chose the Sri Yantra (Nava-Cakra)—a classical geometric structure of 9 interlocking isosceles triangles (4 upward Śiva, 5 downward Śakti) that generate 43 sub-triangles and 54 triple-intersection nodes (marmas).

In computational geometry (studied by A. P. Kulaichev at MSU in 1984 and X. Yue in 2026), constructing these 9 triangles so that all 54 triple intersections meet concurrently is an overdetermined system of non-linear algebraic equations.

In Section 2 of our Whitepaper, we prove an Impossibility Theorem: under classical symmetric boundary constraints, exact simultaneous concurrency across all triple intersections is mathematically impossible—the system inevitably exhibits angular divergence.

To turn this geometry into a high-precision cryptographic primitive, we relaxed the outer boundary constraints and solved the coupled 9-triangle system via L-BFGS-B non-linear optimization, pre-computing a discrete phase space of 4,096 coupled configurations where residual angular error reaches the IEEE 754 double-precision limit:

$$\Delta E \approx 6.13 \times 10^{-11}\text{ rad} < \varepsilon_{\text{float64}}$$


2. Cryptographic Quantization & 256-Bit Bijective Vertex Inversion

When sealing a document, Marma-Crypto computes a parallel cryptographic combiner over three independent hash primitives:

  • GOST 34.311-95 (256-bit)
  • DSTU 7564:2014 "Kupyna" (256-bit Ukrainian national standard)
  • FIPS 180-4 SHA-256 (256-bit)

$$D_{256} = \text{SHA256}\big(\text{GOST}{256}(M) \parallel \text{Kupyna}{256}(M) \parallel \text{SHA256}(M)\big)$$

From this digest (or from an elliptic-curve signature vector $(r, s)$ over $GF(2^{257})$ per DSTU 4145-2002), the protocol derives:

  1. A 24-bit quantized geometric key $K = (k_0, k_1, k_2, k_3)$ governing the base configuration index $k_0 \in {0..4095}$, continuous angular modulation $k_1 \in [-3.0^\circ, +3.0^\circ]$, radial scaling $k_2 \in [0.96, 1.04]$, and 12-bit micro-phase shift $k_3$.
  2. A 256-bit bijective micro-perturbation vector across 26 degrees of freedom of the asymmetric inner vertices (10 bits × 24 + 8 bits × 2 = 256 bits), allowing 100% lossless extraction of the 256-bit digest directly from the PDF/SVG vector coordinates!
  3. A 27th Forensic Canary Channel (D5.ay, 18 nm step) that encodes a recipient_id (0..1023) for leak attribution in M&A and litigation deal rooms without altering the primary 256-bit cryptographic commitment.

3. Zero-Overhead PDF Stream Injection (q ... Q)

Instead of embedding raster images or fragile XMP metadata, Marma-Crypto injects raw ISO 32000-1 PDF graphics operators (q ... m l S Q) directly into the page content stream (~4.1 KB overhead per page) while preserving bilateral symmetry $lx_k + rx_k = 2C_x$ to $10^{-12}\text{ pt}$.

If an attacker alters even a single character in the PDF text—or modifies a single vertex coordinate by $> 10^{-7}$ units—the recomputed digest $D'_{256}$ diverges from the geometry-extracted vector, immediately triggering a TAMPERED alert.


4. Try It Right Now (Browser or Linux CLI)

In Your Browser (100% Client-Side, Zero Backend)

Open yaroslavbaienko.github.io/marma-crypto-protocol:

  1. Interactive Generator: Type any string or hash to watch the 9 interlocking triangles and 54 marma nodes reconfigure in real time on HTML5 Canvas.
  2. Seal Your PDF (Canary Studio): Drop any local PDF, optionally set a Recipient ID (0..1023), and seal it locally in your browser using pdf-lib.
  3. Verify PDF (Tamper Detector): Drop a sealed PDF to verify its 256-bit geometric commitment and extract the forensic Canary ID.

On Debian / Ubuntu Linux


bash
curl -fsSL https://yaroslavbaienko.github.io/legaltech/install.sh | sudo bash
sudo apt install marma-crypto-watermark qes-tools

# Seal and verify a PDF via CLI:
marma-watermark seal contract.pdf -o contract_sealed.pdf --recipient-id 42
marma-watermark verify contract_sealed.pdf --source-file contract.pdf
Enter fullscreen mode Exit fullscreen mode

Top comments (0)