<?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: relay</title>
    <description>The latest articles on DEV Community by relay (@planners1490).</description>
    <link>https://dev.to/planners1490</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%2F4206124%2F111b0fc3-ea9e-48a5-b11a-069ccfdd4678.jpg</url>
      <title>DEV Community: relay</title>
      <link>https://dev.to/planners1490</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/planners1490"/>
    <language>en</language>
    <item>
      <title>Building scLock: A 256-Slot Polymorphic Non-Linear MBA VM Bound to the Apple Secure Enclave (8.15 us Hot Path)</title>
      <dc:creator>relay</dc:creator>
      <pubDate>Sun, 25 Oct 2026 07:20:33 +0000</pubDate>
      <link>https://dev.to/planners1490/building-sclock-a-256-slot-polymorphic-non-linear-mba-vm-bound-to-the-apple-secure-enclave-815-3pd8</link>
      <guid>https://dev.to/planners1490/building-sclock-a-256-slot-polymorphic-non-linear-mba-vm-bound-to-the-apple-secure-enclave-815-3pd8</guid>
      <description>&lt;p&gt;Modern LLM-assisted reverse-engineering agents (coupled with Ghidra, IDA Pro, and Binary Ninja MCP servers) can decompile and patch standard macOS Mach-O (&lt;code&gt;arm64&lt;/code&gt;) binaries in seconds. Traditional symbol stripping (&lt;code&gt;strip -x&lt;/code&gt;) or branch-based &lt;code&gt;ptrace&lt;/code&gt; checks (&lt;code&gt;if (is_debugged) exit(1)&lt;/code&gt;) are trivial to locate and &lt;code&gt;NOP&lt;/code&gt; out.&lt;/p&gt;

&lt;p&gt;Furthermore, conventional software obfuscators suffer from a fatal structural flaw: &lt;strong&gt;they embed static AES/XOR decryption keys inside the Mach-O binary itself&lt;/strong&gt;. Anyone who dumps process memory at runtime can extract the key and reconstruct the underlying control-flow graph.&lt;/p&gt;

&lt;p&gt;We are &lt;strong&gt;relay&lt;/strong&gt; (&lt;code&gt;relay // SYSTEMS&lt;/code&gt;), and we built &lt;strong&gt;&lt;code&gt;scLock&lt;/code&gt; (Supercluster Lock)&lt;/strong&gt; to solve this for native macOS (&lt;code&gt;arm64&lt;/code&gt; Apple Silicon) applications, Rust crates, audio plugins (AU/VST3), and commercial software.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository &amp;amp; Free CrackMe Challenge&lt;/strong&gt;: &lt;a href="https://github.com/planners1490/sclock" rel="noopener noreferrer"&gt;https://github.com/planners1490/sclock&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Benchmarks &amp;amp; Documentation&lt;/strong&gt;: &lt;a href="https://planners1490.github.io/sclock/" rel="noopener noreferrer"&gt;https://planners1490.github.io/sclock/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commercial SDK (macOS arm64)&lt;/strong&gt;: &lt;a href="https://planners3.gumroad.com/l/sclock" rel="noopener noreferrer"&gt;https://planners3.gumroad.com/l/sclock&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The 4 Engineering Constraints Behind &lt;code&gt;scLock&lt;/code&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Zero Keys in the Binary via Physical Apple Secure Enclave (&lt;code&gt;SEP&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Instead of storing decryption keys in &lt;code&gt;__TEXT,__const&lt;/code&gt; or &lt;code&gt;__DATA&lt;/code&gt;, &lt;code&gt;scLock&lt;/code&gt; derives the 128-bit sponge master keys at runtime inside the physical &lt;strong&gt;Apple Silicon Secure Enclave (&lt;code&gt;kSecAttrTokenIDSecureEnclave&lt;/code&gt;)&lt;/strong&gt; coprocessor via hardware-locked P-256 ECDH and &lt;code&gt;HKDF-SHA256&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Static keys stored in binary&lt;/strong&gt;: &lt;code&gt;0 bytes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Even if an attacker extracts the entire Mach-O binary from disk, the key material physically resides inside the Secure Enclave silicon.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Per-Build 256-Slot Polymorphic ISA + Non-Linear MBA ($\mathbb{Z}_{2^{64}}$)
&lt;/h3&gt;

&lt;p&gt;Every invocation of &lt;code&gt;sclock compile&lt;/code&gt; synthesizes a brand-new 256-entry instruction set from a 256-bit OS CSPRNG seed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;172 Active Micro-Handlers&lt;/strong&gt; + &lt;strong&gt;84 State-Corrupting Chaff Traps&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Arithmetic and bitwise operations are expanded into degree-2 and degree-3 &lt;strong&gt;Non-Linear Mixed Boolean-Arithmetic (MBA)&lt;/strong&gt; identities over $\mathbb{Z}_{2^{64}}$, coupled with 2-adic permutation polynomials (&lt;code&gt;P(X) = Q(X) mod 2^64&lt;/code&gt;) and Hensel-lifted opaque predicates ($7x^2 - 1 \not\equiv y^2 \pmod{2^{64}}$).&lt;/li&gt;
&lt;li&gt;When loaded into &lt;strong&gt;Ghidra 11.x&lt;/strong&gt;, &lt;code&gt;DecompileCallback&lt;/code&gt; hits its &lt;strong&gt;&lt;code&gt;&amp;gt;330s&lt;/code&gt; timeout (&lt;code&gt;Decompiler process killed&lt;/code&gt;)&lt;/strong&gt; attempting to simplify the entangled algebraic state graph.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Branchless Anti-Debug State Entanglement
&lt;/h3&gt;

&lt;p&gt;Conditional anti-debug branches (&lt;code&gt;B.EQ&lt;/code&gt;, &lt;code&gt;CBZ&lt;/code&gt;, &lt;code&gt;TBNZ&lt;/code&gt;) are the first thing reverse engineers patch. &lt;code&gt;scLock&lt;/code&gt; emits &lt;strong&gt;zero conditional anti-debug branches&lt;/strong&gt;.&lt;br&gt;
Instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The prologue instruction bytes of all 256 handlers (detecting software &lt;code&gt;BRK&lt;/code&gt; / &lt;code&gt;0xCC&lt;/code&gt; breakpoints) and the kernel &lt;code&gt;sysctl(P_TRACED)&lt;/code&gt; bit (&lt;code&gt;0&lt;/code&gt; or &lt;code&gt;1&lt;/code&gt;) are XOR/ARX-mixed directly into the 256-bit sponge state accumulator.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;lldb&lt;/code&gt; or &lt;code&gt;frida&lt;/code&gt; is attached (&lt;code&gt;P_TRACED == 1&lt;/code&gt;), the sponge keystream silently diverges—causing the VM to decode valid-looking chaff instructions without ever crashing or revealing &lt;em&gt;where&lt;/em&gt; the check occurred.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4. &lt;code&gt;8.15 us&lt;/code&gt; Hot-Path Latency (~120,000 calls/sec)
&lt;/h3&gt;

&lt;p&gt;Using &lt;code&gt;AtomicU64&lt;/code&gt; live-integrity-masked key caching after the initial cold SEP handshake, a single virtualized function call takes &lt;strong&gt;&lt;code&gt;8.15 microseconds&lt;/code&gt; (&lt;code&gt;0.00815 ms&lt;/code&gt;)&lt;/strong&gt; on Apple Silicon—consuming &lt;code&gt;&amp;lt;0.1%&lt;/code&gt; of a 120Hz frame budget (&lt;code&gt;0%&lt;/code&gt; frame drop).&lt;/p&gt;


&lt;h2&gt;
  
  
  Try the Public Reverse-Engineering Challenge (CrackMe)
&lt;/h2&gt;

&lt;p&gt;Don't take our word for it—test &lt;code&gt;scLock&lt;/code&gt; in your own disassembler and debugger right now.&lt;/p&gt;

&lt;p&gt;We published a standalone &lt;code&gt;arm64&lt;/code&gt; Mach-O binary protected by &lt;code&gt;scLock v1.0.0&lt;/code&gt; in our GitHub repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/planners1490/sclock.git
&lt;span class="nb"&gt;cd &lt;/span&gt;sclock/crackme

&lt;span class="c"&gt;# 1. Verify zero symbol or string leaks&lt;/span&gt;
nm &lt;span class="nt"&gt;-gU&lt;/span&gt; ./challenge_protected
strings ./challenge_protected | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-iE&lt;/span&gt; &lt;span class="s2"&gt;"sclock|vm|opcode|mba|chaff"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"0 leaks found"&lt;/span&gt;

&lt;span class="c"&gt;# 2. Run on Apple Silicon&lt;/span&gt;
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x ./challenge_protected
./challenge_protected
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;./challenge_protected&lt;/code&gt; in &lt;strong&gt;Ghidra&lt;/strong&gt;, &lt;strong&gt;IDA Pro&lt;/strong&gt;, &lt;strong&gt;Binary Ninja&lt;/strong&gt;, or &lt;strong&gt;LLDB&lt;/strong&gt; and share your findings in &lt;a href="https://github.com/planners1490/sclock/issues/1" rel="noopener noreferrer"&gt;Issue #1 (Official CrackMe Challenge Thread)&lt;/a&gt;!&lt;/p&gt;




&lt;h2&gt;
  
  
  How the Commercial SDK Works in 3 Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Compile C/C++ into a Zero-Key Hardware-Locked binary (or emit a drop-in Rust crate)&lt;/span&gt;
sclock compile protect_me.c &lt;span class="nt"&gt;-o&lt;/span&gt; protect_me_locked &lt;span class="nt"&gt;--sep-lock&lt;/span&gt;

&lt;span class="c"&gt;# 2. Scrub compiler paths, strip symbols &amp;amp; apply Hardened Runtime to any macOS app&lt;/span&gt;
sclock protect-app ./target/release/my_commercial_app

&lt;span class="c"&gt;# 3. Run the 5-Stage Zero-Leak Security Auditor&lt;/span&gt;
sclock verify ./protect_me_locked
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository &amp;amp; CrackMe&lt;/strong&gt;: &lt;a href="https://github.com/planners1490/sclock" rel="noopener noreferrer"&gt;https://github.com/planners1490/sclock&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Get &lt;code&gt;scLock&lt;/code&gt; Commercial SDK (&lt;code&gt;$79&lt;/code&gt; on Gumroad)&lt;/strong&gt;: &lt;a href="https://planners3.gumroad.com/l/sclock" rel="noopener noreferrer"&gt;https://planners3.gumroad.com/l/sclock&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>architecture</category>
      <category>cybersecurity</category>
      <category>performance</category>
      <category>security</category>
    </item>
  </channel>
</rss>
