<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: zahraarmantech</title>
    <description>The latest articles on DEV Community by zahraarmantech (@zahraarmantech).</description>
    <link>https://dev.to/zahraarmantech</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3953243%2F40e4e158-c70e-4bc9-9429-dd20dc7ac465.png</url>
      <title>DEV Community: zahraarmantech</title>
      <link>https://dev.to/zahraarmantech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zahraarmantech"/>
    <language>en</language>
    <item>
      <title>Stop choosing between smart search and private data</title>
      <dc:creator>zahraarmantech</dc:creator>
      <pubDate>Thu, 11 Jun 2026 23:27:29 +0000</pubDate>
      <link>https://dev.to/zahraarmantech/i-trained-a-neural-network-to-break-my-own-encrypted-search-it-learned-nothing-55f3</link>
      <guid>https://dev.to/zahraarmantech/i-trained-a-neural-network-to-break-my-own-encrypted-search-it-learned-nothing-55f3</guid>
      <description>&lt;p&gt;A few months ago I built a way to search documents by meaning while keeping the embeddings hidden — even from the server doing the search. I called it ZATRON.&lt;/p&gt;

&lt;p&gt;The obvious question everyone (including me) kept asking was: &lt;em&gt;does it actually hide anything, or does it just look scrambled?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Scrambled-looking isn't the same as secure. So instead of trusting a correlation number, I did the thing that actually scares me: I trained a neural network to break it.&lt;/p&gt;

&lt;p&gt;This post is the honest write-up — including the part where I tried hard to make the attack win.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Standard semantic search stores embeddings as plain vectors. Anyone with database access can cluster them by topic and infer content without reading a word. ZATRON transforms each embedding into a &lt;strong&gt;modular barcode&lt;/strong&gt;: project onto PCA channels, quantize, add a per-document keyed mask, and keep only residues modulo a set of primes. You compare barcodes in modular space; the original embedding is never reconstructed.&lt;/p&gt;

&lt;p&gt;Retrieval still works — 98% of cosine quality on 626K MSMARCO passages. The question is whether the barcodes leak.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a correlation number wasn't enough
&lt;/h2&gt;

&lt;p&gt;My first security check was a Spearman correlation between barcode distance and true similarity. It came out near zero (ρ ≈ 0.05). Good — but a low &lt;em&gt;linear&lt;/em&gt; correlation only rules out a &lt;em&gt;simple&lt;/em&gt; attacker. A neural network doesn't need linearity. It can learn whatever structure is there.&lt;/p&gt;

&lt;p&gt;So the real test: give a neural network every advantage and see if it can recover similarity from the barcodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The threat model (making the attacker strong on purpose)
&lt;/h2&gt;

&lt;p&gt;I used a &lt;strong&gt;known-plaintext&lt;/strong&gt; attacker — the strongest realistic setting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It sees all the stored barcodes.&lt;/li&gt;
&lt;li&gt;It also gets &lt;strong&gt;80,000 document pairs with their true cosine similarities&lt;/strong&gt; (as if a chunk of plaintext leaked).&lt;/li&gt;
&lt;li&gt;It trains a model — a linear probe &lt;em&gt;and&lt;/em&gt; a 3-layer MLP — to predict the similarity of unseen pairs from per-prime circular-difference features.&lt;/li&gt;
&lt;li&gt;Train and test pairs share &lt;strong&gt;no&lt;/strong&gt; anchor documents, so it can't just memorize.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the part that makes the result trustworthy: I ran the &lt;strong&gt;identical attack on the unprotected quantized signals&lt;/strong&gt; as a control. If the attack can't break those, the attack is too weak and the test means nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;On 50,000 MSMARCO passages, 100,000 labeled pairs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input the attacker sees&lt;/th&gt;
&lt;th&gt;Linear probe&lt;/th&gt;
&lt;th&gt;MLP (3-layer)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Unprotected signals (control)&lt;/td&gt;
&lt;td&gt;ρ = 0.79, AUC = 0.985&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;ρ = 0.90, AUC = 0.999&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZATRON barcodes&lt;/td&gt;
&lt;td&gt;ρ = 0.00, AUC = 0.498&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;ρ = 0.00, AUC = 0.505&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The same network that recovers similarity from unprotected signals &lt;em&gt;almost perfectly&lt;/em&gt; (AUC 0.999) gets &lt;strong&gt;exactly chance level&lt;/strong&gt; on the barcodes — with 80,000 labeled pairs to learn from. AUC 0.50 is a coin flip.&lt;/p&gt;

&lt;p&gt;It learned nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  I also put it head-to-head with the classic baseline
&lt;/h2&gt;

&lt;p&gt;"8x faster than FHE" is a weak flex — everyone knows FHE is slow. The fairer comparison is &lt;strong&gt;ASPE&lt;/strong&gt; (Wong et al., SIGMOD 2009), the classic encrypted-kNN scheme. ASPE preserves scalar products exactly, so retrieval is perfect — but that same property means any observer can read similarities straight off the ciphertexts.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;ASPE (SIGMOD '09)&lt;/th&gt;
&lt;th&gt;ZATRON&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Retrieval recall@10 (strict)&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;81%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Observer reads similarity directly&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;ρ = +0.87&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ρ = −0.06&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Learned attack (MLP)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;ρ = +0.91, AUC = 0.99&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ρ = +0.01, AUC = 0.52&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;ASPE buys perfect recall with total leakage. ZATRON gives up a margin on the strictest retrieval metric and leaks nothing — to a direct observer &lt;em&gt;or&lt;/em&gt; a trained network.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'm NOT claiming
&lt;/h2&gt;

&lt;p&gt;Honesty is the whole point, so the limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This is the &lt;strong&gt;observer&lt;/strong&gt; threat model. A key holder computing many pairwise distances can still partially recover geometry via MDS (ρ ≈ 0.35) — that's inherent to any distance-preserving scheme, FHE included.&lt;/li&gt;
&lt;li&gt;It is a &lt;strong&gt;randomized privacy-preserving encoding&lt;/strong&gt;, not a reversible cipher, and not yet independently audited by a cryptographer. That's the right bar before anyone calls it production-grade.&lt;/li&gt;
&lt;li&gt;The strict recall metric here (full top-10 set overlap) is harder than the top-1-in-top-10 number I quote elsewhere. Same system, stricter ruler.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it / break it
&lt;/h2&gt;

&lt;p&gt;Everything is reproducible:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;zatron
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The attack and the ASPE comparison are in the repo as runnable scripts (&lt;code&gt;benchmarks/&lt;/code&gt;). If you can make the neural attack win — train it longer, give it more pairs, better features — I genuinely want to see it. Finding the weakness is the point.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code + benchmarks: &lt;a href="https://github.com/zahraarmantech/ZATRON" rel="noopener noreferrer"&gt;https://github.com/zahraarmantech/ZATRON&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Live demo: &lt;a href="https://huggingface.co/spaces/zahraarman/ZATRON" rel="noopener noreferrer"&gt;https://huggingface.co/spaces/zahraarman/ZATRON&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd rather have someone break this now than after I've claimed too much.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>privacy</category>
      <category>security</category>
      <category>python</category>
    </item>
    <item>
      <title>I tried to hide semantic meaning from embeddings without breaking search</title>
      <dc:creator>zahraarmantech</dc:creator>
      <pubDate>Sun, 31 May 2026 14:05:04 +0000</pubDate>
      <link>https://dev.to/zahraarmantech/i-tried-to-hide-semantic-meaning-from-embeddings-without-breaking-search-296f</link>
      <guid>https://dev.to/zahraarmantech/i-tried-to-hide-semantic-meaning-from-embeddings-without-breaking-search-296f</guid>
      <description>&lt;p&gt;Every vector database has the same problem: embeddings leak meaning.&lt;/p&gt;

&lt;p&gt;If someone gets access to your vector store — breach, insider, subpoena — they don’t need to read your documents. They just cluster the embeddings. Five minutes later they know: these 500 vectors are medical records, these 200 are legal cases, these 100 are salary data.&lt;/p&gt;

&lt;p&gt;I wanted to know: can you destroy that structure while keeping search working?&lt;/p&gt;

&lt;h2&gt;
  
  
  The experiment
&lt;/h2&gt;

&lt;p&gt;I took 626,906 real passages from Microsoft’s MSMARCO dataset. I encoded them with a standard sentence transformer. Then I tried to make the embeddings unreadable without killing retrieval quality.&lt;/p&gt;

&lt;p&gt;The approach I landed on: split each embedding into 200 independent channels, quantize each to an integer, mask it with a cryptographic salt, and store only the modular residue after dividing by prime numbers.&lt;/p&gt;

&lt;p&gt;The raw embedding is never stored. It’s never reconstructed. Even the person running the search never sees it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&gt;

&lt;p&gt;Search quality: 98.2% preserved. Out of 500 queries, the protected system returns nearly identical rankings to plain cosine search.&lt;/p&gt;

&lt;p&gt;But here’s the part that surprised me:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyudig8znc3ytw1590vpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyudig8znc3ytw1590vpn.png" alt="Comparison" width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Left side: standard embeddings. Same-topic documents cluster together. An attacker sees everything.&lt;/p&gt;

&lt;p&gt;Right side: same documents after the transformation. Random scatter. No structure.&lt;/p&gt;

&lt;p&gt;And search still returns the same results on both sides.&lt;/p&gt;

&lt;h2&gt;
  
  
  The attack test
&lt;/h2&gt;

&lt;p&gt;I computed every pairwise distance in the protected system and checked: can you figure out which documents &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpbc8opcf2clt3dgdhqsc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpbc8opcf2clt3dgdhqsc.png" alt="AttackComparison" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Left: raw embeddings — perfect correlation between distance and similarity (ρ = 1.00). Attacker wins.&lt;/p&gt;

&lt;p&gt;Right: protected system — no correlation (ρ = 0.09). Attacker gets nothing useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  What didn’t work
&lt;/h2&gt;

&lt;p&gt;Not everything was smooth. Some things I learned the hard way:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BGE embeddings don’t quantize well.&lt;/strong&gt; MiniLM and MPNet both hit 98%+. BGE dropped to 87%. The embedding distribution matters — models that spread information more uniformly across dimensions lose more during quantization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Small primes break everything.&lt;/strong&gt; When I used primes smaller than the number of quantization bins, retrieval quality collapsed from 98% to 38%. The modular reduction needs to be injective — primes must be larger than the bin count. This took me a while to figure out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The key holder can partially recover geometry.&lt;/strong&gt; If someone with the key computes thousands of pairwise distances, they can approximate the original embedding structure using MDS (ρ = 0.63). I mitigated this to 0.35 with a log transform, but it’s a fundamental limitation of any distance-preserving scheme. FHE has the same issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this actually is
&lt;/h2&gt;

&lt;p&gt;I want to be precise: this is NOT encryption in the AES sense. You can’t decrypt a barcode back to an embedding. It’s a randomized privacy-preserving encoding — barcodes are computationally indistinguishable from random without the key, under standard cryptographic assumptions (PRF/HMAC-SHA256).&lt;/p&gt;

&lt;h2&gt;
  
  
  Speed
&lt;/h2&gt;

&lt;p&gt;On the same hardware (Colab T4 GPU), fully homomorphic encryption (CKKS) takes 38.9ms per comparison. This system takes 5ms. Integer arithmetic only, no GPU needed for the comparison step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;I built a live demo where you can see this working in real time — search both systems side by side:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://huggingface.co/spaces/zahraarman/ZATRON" rel="noopener noreferrer"&gt;https://huggingface.co/spaces/zahraarman/ZATRON&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/zahraarmantech/ZATRON" rel="noopener noreferrer"&gt;https://github.com/zahraarmantech/ZATRON&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run locally:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;sentence-transformers scikit-learn matplotlib
python demo.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I want to know
&lt;/h2&gt;

&lt;p&gt;I’m an independent researcher. I built this because I wanted to know if it was possible. It appears to work, but I’m sure there are things I’m missing.&lt;/p&gt;

&lt;p&gt;If you work on vector search, privacy, or retrieval systems — what would break this? What am I not seeing?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Zahra Arman — Independent Researcher&lt;br&gt;
*The method is covered by a US provisional patent.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>machinelearning</category>
      <category>privacy</category>
      <category>security</category>
    </item>
    <item>
      <title>What happens when you hide embeddings but keep search working?</title>
      <dc:creator>zahraarmantech</dc:creator>
      <pubDate>Tue, 26 May 2026 21:16:03 +0000</pubDate>
      <link>https://dev.to/zahraarmantech/what-happens-when-you-hide-embeddings-but-keep-search-working-3mi2</link>
      <guid>https://dev.to/zahraarmantech/what-happens-when-you-hide-embeddings-but-keep-search-working-3mi2</guid>
      <description>&lt;p&gt;What happens when you hide embeddings but keep search working?&lt;/p&gt;

&lt;p&gt;I spent the last few months building a system that does something counterintuitive: it takes semantic search embeddings, makes them completely unreadable, and somehow search still works at 98% quality.&lt;/p&gt;

&lt;p&gt;Here’s what that looks like.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem nobody talks about
&lt;/h2&gt;

&lt;p&gt;Every company using semantic search has a dirty secret: their vector database is a map of their entire document collection’s meaning.&lt;/p&gt;

&lt;p&gt;Embeddings cluster by topic. If someone gets access to your vector database — a breach, an insider, a subpoena — they don’t need to read a single document. They can cluster the embeddings and immediately see: these 500 documents are about cancer patients, these 200 are about ongoing litigation, these 100 are salary records.&lt;/p&gt;

&lt;p&gt;No decryption needed. The structure IS the leak.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyudig8znc3ytw1590vpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyudig8znc3ytw1590vpn.png" alt="Raw embeddings leak topic structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look at the left side. Same-color dots represent same-topic documents. They cluster together — an attacker immediately sees the structure. The right side is the same 50 documents after ZATRON processing. Random noise. No clusters. No structure.&lt;/p&gt;

&lt;p&gt;But here’s the thing: search returns the exact same results on both sides.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;ZATRON (Zero-Access Transformed Retrieval Over Noise) transforms embeddings into modular barcodes. The process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Project the embedding onto 200 independent channels (PCA)&lt;/li&gt;
&lt;li&gt;Quantize each channel to an integer (0–49)&lt;/li&gt;
&lt;li&gt;Mask each value with a cryptographic salt unique to each document&lt;/li&gt;
&lt;li&gt;Store only the modular residues (remainder after dividing by prime numbers)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The key insight: modular arithmetic preserves distance relationships but destroys the original values. Two similar documents produce similar modular distances. But the individual barcodes look like random numbers.&lt;/p&gt;

&lt;p&gt;Without the key, you can’t unmask them. With the key, you can compare them. You never reconstruct the original embedding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does it actually work?
&lt;/h2&gt;

&lt;p&gt;I tested on real data, not toy examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MSMARCO passage retrieval — 626,906 real documents:&lt;/strong&gt;&lt;br&gt;
The system preserves 98.2% of cosine search quality. Out of 500 queries, the encrypted system returns nearly identical rankings to unencrypted cosine search.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three different embedding models:&lt;/strong&gt;&lt;br&gt;
MiniLM: 98.2%. MPNet: 99.2%. BGE: 86.6% (this model’s embedding distribution is less quantization-friendly — I report this honestly).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Five languages:&lt;/strong&gt;&lt;br&gt;
Arabic, Spanish, Korean, Chinese, English — all above 88%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparison with existing methods:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Quality&lt;/th&gt;
&lt;th&gt;Encrypted?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Binary quantization&lt;/td&gt;
&lt;td&gt;96.9%&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scalar int8&lt;/td&gt;
&lt;td&gt;98.8%&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Product quantization&lt;/td&gt;
&lt;td&gt;97.9%&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZATRON&lt;/td&gt;
&lt;td&gt;99.6%&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Higher quality than every quantization method — and the only one that’s encrypted.&lt;/p&gt;
&lt;h2&gt;
  
  
  Can an attacker break it?
&lt;/h2&gt;

&lt;p&gt;I ran eight independent attack vectors. All passed.&lt;/p&gt;

&lt;p&gt;But the most convincing evidence is visual:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8hk75whtgspti3hx12ad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8hk75whtgspti3hx12ad.png" alt="Attack analysis"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Left: raw embedding distances perfectly predict true document similarity (ρ = 1.00). An attacker with database access knows exactly which documents are related.&lt;/p&gt;

&lt;p&gt;Right: ZATRON barcode distances show zero correlation with true similarity (ρ = 0.09). The attacker gets nothing.&lt;/p&gt;
&lt;h2&gt;
  
  
  What about FHE?
&lt;/h2&gt;

&lt;p&gt;Fully homomorphic encryption (CKKS) can do encrypted search too. But on the same hardware (Google Colab, T4 GPU), CKKS takes 38.9ms per comparison. ZATRON takes 5ms. That’s 8x faster, using only integer arithmetic, no GPU needed.&lt;/p&gt;

&lt;p&gt;Both are computationally secure — CKKS under Ring-LWE, ZATRON under PRF (HMAC-SHA256). Different assumptions, both standard.&lt;/p&gt;
&lt;h2&gt;
  
  
  What this is NOT
&lt;/h2&gt;

&lt;p&gt;I want to be precise about what ZATRON is and isn’t:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is NOT classical encryption like AES. You can’t “decrypt” a barcode back to an embedding.&lt;/li&gt;
&lt;li&gt;It IS a randomized privacy-preserving encoding. Barcodes are computationally indistinguishable from random without the key.&lt;/li&gt;
&lt;li&gt;A key holder who computes many pairwise distances CAN partially recover embedding geometry (ρ = 0.63, mitigated to 0.35 with log transform). This is inherent to any distance-preserving scheme, including FHE.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I state these limitations explicitly because overselling helps nobody.&lt;/p&gt;
&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Live demo (no install needed):&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://huggingface.co/spaces/zahraarman/ZATRON" rel="noopener noreferrer"&gt;https://huggingface.co/spaces/zahraarman/ZATRON&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code and paper:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/zahraarmantech/ZATRON" rel="noopener noreferrer"&gt;https://github.com/zahraarmantech/ZATRON&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run locally:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;sentence-transformers scikit-learn matplotlib
python demo.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Who needs this?
&lt;/h2&gt;

&lt;p&gt;Any organization that searches sensitive documents: hospitals (patient records), law firms (case files), financial institutions (client data), defense (classified documents).&lt;/p&gt;

&lt;p&gt;The EU AI Act and GDPR are making embedding privacy a compliance issue, not just a nice-to-have.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s next
&lt;/h2&gt;

&lt;p&gt;The system works. The patent is filed. I’m looking for technical feedback, especially from people building vector search infrastructure.&lt;/p&gt;

&lt;p&gt;If you work on vector databases, privacy-preserving ML, or searchable encryption — I’d genuinely appreciate your thoughts. What did I miss? What would break it? What would make it useful?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Zahra Arman — Independent Researcher, Plano TX&lt;/em&gt;&lt;br&gt;
&lt;em&gt;US Provisional Patent Pending&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>privacy</category>
      <category>python</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
