<?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: Noir</title>
    <description>The latest articles on DEV Community by Noir (@entrouter).</description>
    <link>https://dev.to/entrouter</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3831559%2F1adea6fc-7a07-420e-91d2-99747c6017fb.png</url>
      <title>DEV Community: Noir</title>
      <link>https://dev.to/entrouter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/entrouter"/>
    <language>en</language>
    <item>
      <title>I Built a Cryptographic Cipher From Scratch. 5.22 GiB/s. 251 Tests. Zero Borrowed Code.</title>
      <dc:creator>Noir</dc:creator>
      <pubDate>Tue, 24 Mar 2026 05:08:18 +0000</pubDate>
      <link>https://dev.to/entrouter/i-built-a-cryptographic-cipher-from-scratch-522-gibs-251-tests-zero-borrowed-code-4mko</link>
      <guid>https://dev.to/entrouter/i-built-a-cryptographic-cipher-from-scratch-522-gibs-251-tests-zero-borrowed-code-4mko</guid>
      <description>&lt;h2&gt;
  
  
  The One-Sentence Version
&lt;/h2&gt;

&lt;p&gt;In every cipher ever published, symbol &lt;code&gt;A&lt;/code&gt; has a fixed value. Encryption hides what &lt;code&gt;A&lt;/code&gt; means. In &lt;strong&gt;KK&lt;/strong&gt;, symbol &lt;code&gt;A&lt;/code&gt; has &lt;em&gt;no fixed value&lt;/em&gt;. Its value is a function of the universe at the instant it was born.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;KK(S) = S XOR E : state XOR universal entropy at the precise instant of creation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Encode the same byte twice, one nanosecond apart, and you get two cryptographically unrelated outputs. Not different ciphertext from the same algorithm. A &lt;strong&gt;structurally different cipher&lt;/strong&gt; at each moment.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I Built This
&lt;/h2&gt;

&lt;p&gt;I wanted to answer a question nobody was asking: &lt;em&gt;What if the cipher itself changed shape every time you used it?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every mainstream cipher (AES, ChaCha20, Keccak) treats its algebraic structure as fixed. The key selects a path through that structure, but the structure itself is a constant. KK flips this. The permutation's rotation schedule is derived from real-world entropy (CPU counters, thread jitter, OS randomness), so the algebraic structure of the cipher is different on every single invocation.&lt;/p&gt;

&lt;p&gt;The result is a 1600-bit sponge construction with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;32 rounds&lt;/strong&gt;, each with &lt;strong&gt;15 quintet operations&lt;/strong&gt; = 480 quintet-rounds total&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two novel operations&lt;/strong&gt; no published cipher uses (MFR and Data-Dependent Rotation)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5-word quintet mixing&lt;/strong&gt; (no published cipher uses 5-word rounds)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Entropy-derived rotation schedules&lt;/strong&gt; per invocation&lt;/li&gt;
&lt;li&gt;Computed differential trail bound of &lt;strong&gt;2^-26,712&lt;/strong&gt; and linear trail bound of &lt;strong&gt;2^-2,544&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And every cryptographic primitive ships from this single permutation. No external dependencies.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Ships in the Box
&lt;/h2&gt;

&lt;p&gt;Everything below is built from the KK permutation alone:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Primitive&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;KK-Hash&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;256-bit collision-resistant hash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;KK-KDF&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Key derivation with per-derivation rotation schedule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;KK-MAC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Message authentication, constant-time verify&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;KK-AEAD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Authenticated encryption with associated data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Rope Ratchet&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;4-strand forward-secret session protocol&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;KK-EKA&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3-message key agreement, zero external primitives&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;KK-RNG&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Forward-secret DRBG, ratchets on every call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Temporal Commitment&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Binds ciphertext to the exact entropic instant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Streaming&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Chunk-based large message support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AVX-512 Batch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;8 sponge states in lockstep across 512-bit registers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GPU&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;wgpu + CUDA acceleration, byte-identical to CPU&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;no_std&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Bare core for embedded / WASM&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Zero external cryptographic dependencies. Not "we wrap AES for the heavy lifting." Zero.&lt;/p&gt;




&lt;h2&gt;
  
  
  Show Me the Code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;kk_crypto&lt;/span&gt;&lt;span class="p"&gt;::{&lt;/span&gt;&lt;span class="n"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;b"our-shared-secret"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Encode: symbol values become functions of this cosmic instant&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;packet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;b"Hello KK!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Decode: same secret, same moment reference, same message&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;plaintext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;packet&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nd"&gt;assert_eq!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;plaintext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;b"Hello KK!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AEAD:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;kk_crypto&lt;/span&gt;&lt;span class="p"&gt;::{&lt;/span&gt;&lt;span class="n"&gt;encode_aead&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decode_aead&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;b"our-shared-secret"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;aad&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;b"metadata-not-encrypted-but-authenticated"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;packet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;encode_aead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aad&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;b"secret payload"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;plaintext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;decode_aead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aad&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;packet&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Forward-secret sessions with the Rope Ratchet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;kk_crypto&lt;/span&gt;&lt;span class="p"&gt;::{&lt;/span&gt;&lt;span class="n"&gt;encode_session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decode_session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;RopeRatchet&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;b"session-key"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;alice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;RopeRatchet&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;bob&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;RopeRatchet&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;packet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;encode_session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;alice&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;b"message 1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;plaintext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;decode_session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;bob&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;packet&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// Old keys are gone. Backward computation is impossible.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;All numbers on a single AMD Ryzen 9 9950X3D. Criterion framework, 100 samples per benchmark.&lt;/p&gt;

&lt;h3&gt;
  
  
  Batch AEAD
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workload&lt;/th&gt;
&lt;th&gt;Throughput&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1,000 x 64 KB&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;5.22 GiB/s&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1,000 x 16 KB&lt;/td&gt;
&lt;td&gt;2.40 GiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1,000 x 4 KB&lt;/td&gt;
&lt;td&gt;1.53 GiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Core Primitives
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Primitive&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;KK permutation (32 rounds)&lt;/td&gt;
&lt;td&gt;1.14 us&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KK-Hash&lt;/td&gt;
&lt;td&gt;186 MiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KK-MAC&lt;/td&gt;
&lt;td&gt;127 MiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KK-KDF&lt;/td&gt;
&lt;td&gt;145 MiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KK-RNG (forward-secret per call)&lt;/td&gt;
&lt;td&gt;186 MiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KK-EKA handshake&lt;/td&gt;
&lt;td&gt;44.6 us (22,400/sec)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Scaling
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Config&lt;/th&gt;
&lt;th&gt;Throughput&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Single core (AVX-512)&lt;/td&gt;
&lt;td&gt;497 MiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16 threads&lt;/td&gt;
&lt;td&gt;4.09 GiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;32 threads (SMT)&lt;/td&gt;
&lt;td&gt;5.22 GiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU (CUDA, RTX 5080)&lt;/td&gt;
&lt;td&gt;2.08 GiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For context: single-core throughput matches SHA-3/Keccak while doing significantly more work per byte (entropy capture, temporal binding, per-chunk key derivation).&lt;/p&gt;




&lt;h2&gt;
  
  
  The Novel Operations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  MFR (Multiply-Fold-Rotate)
&lt;/h3&gt;

&lt;p&gt;Widening 64-bit multiply, fold XOR, fixed rotation. Non-linear, bijective, full-word mixing. Every bit of input affects every bit of output within a single application.&lt;/p&gt;

&lt;h3&gt;
  
  
  DDR (Data-Dependent Rotation)
&lt;/h3&gt;

&lt;p&gt;The rotation distance is derived from all 64 bits of the input word. This is implemented as constant-time branchless code, so no timing side-channels. The critical property: &lt;strong&gt;no published linear or differential analysis framework efficiently handles data-dependent rotations.&lt;/strong&gt; The best an attacker can do is assume uniform rotation distribution, which gives a provable per-quintet linear probability ceiling of LP &amp;lt;= 2^-12.&lt;/p&gt;

&lt;p&gt;Together, these operations interact to create what I call &lt;strong&gt;complementary duality&lt;/strong&gt;: the MSB differential weakness of MFR and the LSB linear weakness sit at opposite ends of the word. No single bit position is exploitable in both attack dimensions simultaneously.&lt;/p&gt;




&lt;h2&gt;
  
  
  Formal Analysis Highlights
&lt;/h2&gt;

&lt;p&gt;I didn't just build it and hope. The repository includes formal differential and linear analysis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Full Difference Distribution Table (DDT)&lt;/strong&gt; computed for a reduced sponge&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full Linear Approximation Table (LAT)&lt;/strong&gt; computed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bit-0 independence proof:&lt;/strong&gt; Bit 0 never reaches the DDR rotation distance, proving its differential trail bound is exact (not a statistical artifact)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4-round full diffusion&lt;/strong&gt; confirmed when DDR floor is included&lt;/li&gt;
&lt;li&gt;Differential bound &lt;strong&gt;33,390x beyond 2^-800 target&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Linear bound &lt;strong&gt;3.18x beyond 2^-800 target&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All analysis code ships in &lt;code&gt;/examples/&lt;/code&gt; so you can reproduce every number.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Honest Parts
&lt;/h2&gt;

&lt;p&gt;Let me be upfront about what KK is and isn't:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;KK has not been peer-reviewed.&lt;/strong&gt; It's submitted to IACR ePrint (2026/108500), but no third-party cryptographer has audited it yet. Don't use it for production security until that happens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The base codec has no replay protection.&lt;/strong&gt; You need sequence numbers or timestamps at the protocol layer. (The Rope Ratchet sessions do provide forward secrecy.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is novel cryptography.&lt;/strong&gt; The entire cryptographic community's default position on novel ciphers is skepticism, and rightly so. I welcome that scrutiny.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Numbers That Matter
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tests passing&lt;/td&gt;
&lt;td&gt;251 (zero failures)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fuzz targets&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lines of Rust&lt;/td&gt;
&lt;td&gt;~8,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;External crypto deps&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Differential trail bound&lt;/td&gt;
&lt;td&gt;2^-26,712&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linear trail bound&lt;/td&gt;
&lt;td&gt;2^-2,544&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Batch AEAD throughput&lt;/td&gt;
&lt;td&gt;5.22 GiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Forward-secret handshakes&lt;/td&gt;
&lt;td&gt;22,400/sec&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[dependencies]&lt;/span&gt;
&lt;span class="py"&gt;kk-crypto&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;test&lt;/span&gt;            &lt;span class="c"&gt;# 251 tests&lt;/span&gt;
cargo bench           &lt;span class="c"&gt;# 56 criterion benchmarks&lt;/span&gt;
cargo clippy          &lt;span class="c"&gt;# zero warnings&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;no_std&lt;/code&gt; for embedded/WASM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[dependencies]&lt;/span&gt;
&lt;span class="py"&gt;kk-crypto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;default-features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Entrouter/KK-Keeney-Kode" rel="noopener noreferrer"&gt;github.com/Entrouter/KK-Keeney-Kode&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;crates.io:&lt;/strong&gt; &lt;a href="https://crates.io/crates/kk-crypto" rel="noopener noreferrer"&gt;crates.io/crates/kk-crypto&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ePrint:&lt;/strong&gt; &lt;a href="https://eprint.iacr.org/2026/108500" rel="noopener noreferrer"&gt;eprint.iacr.org/2026/108500&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contact:&lt;/strong&gt; &lt;a href="mailto:hello@entrouter.com"&gt;hello@entrouter.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;KK is Apache 2.0 with Additional Terms (non-commercial). See the LICENSE for details.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'd love feedback, especially from anyone who works in cryptanalysis. If you can break it, I want to know. That's the whole point of publishing.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>cryptography</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Can you stop packet loss completely, dunno, maybe..?</title>
      <dc:creator>Noir</dc:creator>
      <pubDate>Wed, 18 Mar 2026 14:32:33 +0000</pubDate>
      <link>https://dev.to/entrouter/can-you-stop-packet-loss-completely-dunno-maybe-n66</link>
      <guid>https://dev.to/entrouter/can-you-stop-packet-loss-completely-dunno-maybe-n66</guid>
      <description>&lt;p&gt;If you've ever had a TCP connection between two distant regions, say London to Sydney, you already know what happens. A tiny bit of packet loss and your p95 latency goes off a cliff. TCP retransmits are brutal over long routes.&lt;br&gt;
The standard answer is "just deal with it" or "pay for a premium network." Neither felt right so I built something else.&lt;br&gt;
entrouter-line is a cross-region relay that sits between your nodes and absorbs packet loss using Reed-Solomon Forward Error Correction. The idea is simple, instead of waiting for TCP to detect loss and retransmit, FEC sends enough redundancy that the receiving end can reconstruct missing packets without asking for them again.&lt;br&gt;
The numbers on London to Sydney over cheap Vultr VPS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0% loss  →  relay p95: 280ms  |  direct TCP p95: 271ms  (TCP wins by 9ms, fair)
1% loss  →  relay p95: 280ms  |  direct TCP p95: 758ms  (relay wins by 478ms)
3% loss  →  relay p95: 280ms  |  direct TCP p95: 817ms  (relay wins by 537ms)
5% loss  →  relay p95: 280ms  |  direct TCP p95: 1089ms (relay wins by 809ms)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Relay latency is dead flat whether there's 0% or 5% loss. TCP p95 just keeps climbing.&lt;br&gt;
At baseline the relay adds ~9ms for encryption + FEC + UDP tunnelling. The moment any loss appears that cost pays for itself immediately.&lt;br&gt;
A few other things it does:&lt;/p&gt;

&lt;p&gt;Routing via real-time latency mesh with Dijkstra shortest-path, not BGP. It actually measures which path is fastest right now and uses that.&lt;br&gt;
QUIC 0-RTT edge termination so new connections are instant.&lt;br&gt;
All inter-node traffic encrypted with ChaCha20-Poly1305. No PKI needed, just a shared key per peer.&lt;br&gt;
Zero relay overhead, measured loss exactly matches simulated network loss. The relay itself adds nothing.&lt;/p&gt;

&lt;p&gt;It handles up to 10% link loss with perfect recovery and degrades gracefully up to around 22%. Above 25% loss on a 273ms RTT route even QUIC starts falling apart, that's a physical constraint, not a code one. Real backbone loss between major cities is typically under 2% so in practice this covers everything short of a damaged undersea cable.&lt;br&gt;
Written in Rust. Single binary. Docker image available.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;entrouter-line
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/Entrouter/entrouter-line" rel="noopener noreferrer"&gt;https://github.com/Entrouter/entrouter-line&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Curious if anyone else has dealt with cross-region tail latency issues and what they ended up doing about it.&lt;/p&gt;

&lt;p&gt;Noir - Out&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>opensource</category>
      <category>networking</category>
    </item>
    <item>
      <title>I got tired of escaping quotes in SSH commands, so I made a small CLI tool that sidesteps the problem entirely.</title>
      <dc:creator>Noir</dc:creator>
      <pubDate>Wed, 18 Mar 2026 14:10:41 +0000</pubDate>
      <link>https://dev.to/entrouter/i-got-tired-of-escaping-quotes-in-ssh-commands-so-i-made-a-small-cli-tool-that-sidesteps-the-270</link>
      <guid>https://dev.to/entrouter/i-got-tired-of-escaping-quotes-in-ssh-commands-so-i-made-a-small-cli-tool-that-sidesteps-the-270</guid>
      <description>&lt;p&gt;I built a CLI tool and Rust crate that solves a problem I kept running into shell escaping breaking commands when piping them through SSH, Docker exec, kubectl exec, or cron.&lt;/p&gt;

&lt;p&gt;The idea is simple. Instead of fighting with nested quotes and backslashes, you pipe your command through entrouter, which base64-encodes it locally, sends it to the target, decodes it there, and executes it. The command never touches an intermediate shell, so quotes, JSON, special characters all arrive intact.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'curl -s -X POST -H "Content-Type: application/json" -d {"key":"value"} http://localhost:3000/api'&lt;/span&gt; | entrouter ssh root@your-vps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No escaping. First try. Every time.&lt;/p&gt;

&lt;p&gt;What it does:&lt;/p&gt;

&lt;p&gt;entrouter ssh  - run commands on remote machines without escaping&lt;/p&gt;

&lt;p&gt;entrouter docker  - run commands inside containers without escaping&lt;/p&gt;

&lt;p&gt;entrouter kube  - run commands inside Kubernetes pods without escaping&lt;/p&gt;

&lt;p&gt;entrouter cron [schedule] - encode commands into cron-safe lines (no % breakage)&lt;/p&gt;

&lt;p&gt;entrouter exec - decode and execute locally (safe command storage)&lt;/p&gt;

&lt;p&gt;entrouter encode/decode/verify - base64 + SHA-256 fingerprinting for data integrity&lt;/p&gt;

&lt;p&gt;entrouter raw-encode/raw-decode - plain base64 for piping&lt;/p&gt;

&lt;p&gt;Beyond the CLI, the library side gives you four integrity tools:&lt;/p&gt;

&lt;p&gt;Envelope - wrap data in base64 with a SHA-256 fingerprint. Four flavors: standard, URL-safe, compressed, and TTL (self-expiring).&lt;/p&gt;

&lt;p&gt;Chain - cryptographic audit trail where each link references the previous fingerprint. Tamper with one link and everything after it breaks.&lt;/p&gt;

&lt;p&gt;UniversalStruct - per-field integrity verification. Tells you exactly which field was tampered with, not just "something broke."&lt;/p&gt;

&lt;p&gt;Guardian - checkpoint data at every layer of your pipeline. Tells you exactly which layer corrupted it.&lt;/p&gt;

&lt;p&gt;28 tests covering SQL injection strings, null bytes, unicode edge cases, emoji, XSS payloads, Redis protocol characters, path traversal, format strings, and zero-width characters.&lt;/p&gt;

&lt;p&gt;A few things that might matter to you:&lt;/p&gt;

&lt;p&gt;Single static binary, no runtime. No Python, no Node, no dependencies. cargo install and done.&lt;br&gt;
Multi-host support. `&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;shell&lt;br&gt;
echo 'systemctl restart nginx' | entrouter ssh root@web1,root@web2,root@web3&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
`, runs sequentially, shows output per host.&lt;br&gt;
Connection multiplexing built in. First SSH takes normal time, subsequent calls to the same host reuse the connection and complete near-instantly. Handy if you're scripting a bunch of commands against the same box.&lt;br&gt;
Integrity verification. Every encoded payload gets a SHA-256 fingerprint, so you can verify nothing got mangled in transit if you're paranoid like me. It's ~3MB. That's it. That's the whole tool.&lt;/p&gt;

&lt;p&gt;I know heredoc and base64 piping exist, I've done that dance too. This just wraps it into something I don't have to think about anymore. If you manage boxes and regularly SSH commands with gnarly quoting, give it a look.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="sb"&gt;`&lt;/span&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;entrouter-universal&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/Entrouter/entrouter-universal" rel="noopener noreferrer"&gt;https://github.com/Entrouter/entrouter-universal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;crates.io: &lt;a href="https://crates.io/crates/entrouter-universal" rel="noopener noreferrer"&gt;https://crates.io/crates/entrouter-universal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Docs: &lt;a href="https://docs.rs/entrouter-universal" rel="noopener noreferrer"&gt;https://docs.rs/entrouter-universal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would love to hear feedback or ideas for other transports worth supporting.&lt;/p&gt;

&lt;p&gt;Just looking to see if this could be helpful for anyone. &lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

</description>
      <category>cli</category>
      <category>rust</category>
      <category>showdev</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
