<?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: Zero Heartbeat</title>
    <description>The latest articles on DEV Community by Zero Heartbeat (@zero_heartbeat_06a3625d7a).</description>
    <link>https://dev.to/zero_heartbeat_06a3625d7a</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%2F3782380%2Fa9edbbf7-36b9-434e-8c5d-238ab3ad0caf.png</url>
      <title>DEV Community: Zero Heartbeat</title>
      <link>https://dev.to/zero_heartbeat_06a3625d7a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zero_heartbeat_06a3625d7a"/>
    <language>en</language>
    <item>
      <title>Encrypting attributes that leak your intent</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 20:12:20 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/encrypting-attributes-that-leak-your-intent-2ek</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/encrypting-attributes-that-leak-your-intent-2ek</guid>
      <description>&lt;p&gt;Rename everything in a .NET assembly and one thing stays in plain English. A renamer turns your types and methods into &lt;code&gt;a1&lt;/code&gt;, &lt;code&gt;b2&lt;/code&gt;, &lt;code&gt;c3&lt;/code&gt;, but open the result in a metadata viewer and the custom attributes still read like a design document: &lt;code&gt;[Obsolete("replaced by the new vault API")]&lt;/code&gt;, &lt;code&gt;[Inject(typeof(IPaymentGateway))]&lt;/code&gt;, &lt;code&gt;[assembly: InternalsVisibleTo("Acme.Billing.Tests")]&lt;/code&gt;. The symbols are gone; the &lt;em&gt;intent&lt;/em&gt; is not. A reader learns you have a vault API, a payment gateway abstraction, and a billing test assembly — from metadata that renaming was supposed to have scrubbed.&lt;/p&gt;

&lt;p&gt;The reason is structural. Renaming rewrites the &lt;code&gt;#Strings&lt;/code&gt; heap — the names of types, methods, and fields. An attribute's &lt;em&gt;arguments&lt;/em&gt; do not live there. They live in the &lt;code&gt;#Blob&lt;/code&gt; heap, in a documented binary format, pointed at by a row in the &lt;code&gt;CustomAttribute&lt;/code&gt; table, and a renamer never touches them. So the question this post answers: how do you keep attribute arguments from leaking intent, when the one transform you reached for cannot see them? Nebula Pro's answer is a keep/strip/encrypt policy — strip the attributes nothing reads at runtime, encrypt the blobs of the ones that must remain, and rebuild them through a generated accessor. First, the bytes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the blob actually stores
&lt;/h2&gt;

&lt;p&gt;Take the message that gives the game away:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Obsolete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"replaced by the new vault API"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;SaveToLegacyVault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; … &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;[Obsolete]&lt;/code&gt; application compiles into a row in the &lt;code&gt;CustomAttribute&lt;/code&gt; table — a coded token for the target method, a token for the &lt;code&gt;ObsoleteAttribute(string)&lt;/code&gt; constructor, and an offset into &lt;code&gt;#Blob&lt;/code&gt;. The blob at that offset is where the string lives, serialized per ECMA-335 §II.23.3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.custom instance void [System.Runtime]System.ObsoleteAttribute::.ctor(string) = (
    01 00 1D 72 65 70 6C 61 63 65 64 20 62 79 20 74   // ...replaced by t
    68 65 20 6E 65 77 20 76 61 75 6C 74 20 41 50 49   // he new vault API
    00 00 )                                           // ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thirty-four bytes, and the whole sentence is in there in the clear. Sliced:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bytes&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;01 00&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Prolog — always &lt;code&gt;0x0001&lt;/code&gt;, little-endian&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;1D&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;SerString&lt;/code&gt; length: compressed unsigned &lt;code&gt;29&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;72 65 70 … 41 50 49&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;29 UTF-8 bytes: "replaced by the new vault API"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;00 00&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;NumNamed&lt;/code&gt; = 0 named arguments&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The format is fixed. The 2-byte prolog &lt;code&gt;0x0001&lt;/code&gt; comes first. Then the &lt;em&gt;fixed&lt;/em&gt; arguments — the constructor's positional parameters, here a single &lt;code&gt;string&lt;/code&gt; — serialized in signature order with &lt;strong&gt;no type tags and no names&lt;/strong&gt;: a &lt;code&gt;SerString&lt;/code&gt; is a compressed-length prefix followed by that many UTF-8 bytes (&lt;code&gt;0xFF&lt;/code&gt; marks a null string, distinct from the &lt;code&gt;0x00&lt;/code&gt; of an empty one). After the fixed arguments comes a 2-byte &lt;code&gt;NumNamed&lt;/code&gt; count, and then, if it is non-zero, each named argument begins with a tag byte — &lt;code&gt;0x53&lt;/code&gt; for &lt;code&gt;FIELD&lt;/code&gt;, &lt;code&gt;0x54&lt;/code&gt; for &lt;code&gt;PROPERTY&lt;/code&gt; — followed by its element type, a &lt;code&gt;SerString&lt;/code&gt; name, and the value. (For how a decoder reconstructs the full &lt;em&gt;value&lt;/em&gt; from these bytes, including enums and &lt;code&gt;typeof&lt;/code&gt; arguments, see Glass's &lt;a href="https://delta1labs.com/blog/glass-decode-custom-attribute-blobs" rel="noopener noreferrer"&gt;walk through the same format&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;The point for obfuscation is narrower and sharper: &lt;strong&gt;the string &lt;code&gt;"replaced by the new vault API"&lt;/code&gt; is sitting verbatim in the file.&lt;/strong&gt; Rename &lt;code&gt;SaveToLegacyVault&lt;/code&gt; to &lt;code&gt;a7&lt;/code&gt; and the blob does not change one byte — the renamer rewrites &lt;code&gt;#Strings&lt;/code&gt;, not &lt;code&gt;#Blob&lt;/code&gt;. The same is true of &lt;code&gt;[Inject(typeof(IPaymentGateway))]&lt;/code&gt;, whose blob carries the assembly-qualified type name; of serialization hints that name your wire contract; and of &lt;code&gt;[assembly: InternalsVisibleTo("Acme.Billing.Tests")]&lt;/code&gt;, which announces an internal seam and a test assembly to anyone who reads the manifest. None of it is code. All of it is intent, stored as data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The caveat that scopes the whole technique
&lt;/h2&gt;

&lt;p&gt;Before any attribute is touched, one rule dominates: &lt;strong&gt;many custom attributes are consumed by the CLR, the JIT, the loader, or a framework during type load, and they must not be stripped or encrypted.&lt;/strong&gt; &lt;code&gt;StructLayout&lt;/code&gt; and &lt;code&gt;FieldOffset&lt;/code&gt; decide how a type is laid out in memory. &lt;code&gt;MarshalAs&lt;/code&gt;, &lt;code&gt;DllImport&lt;/code&gt;, and &lt;code&gt;LibraryImport&lt;/code&gt; drive P/Invoke. &lt;code&gt;Serializable&lt;/code&gt;, security attributes, and interop attributes are read by the runtime itself, often before any of your code runs. Remove or encrypt one of those and you do not obfuscate the program — you break it, or silently change its semantics.&lt;/p&gt;

&lt;p&gt;And there is a second, structural limit. You cannot transparently intercept &lt;code&gt;Type.GetCustomAttributes&lt;/code&gt; for arbitrary third-party callers. A DI container, a serializer, or a validation framework that reflects over your attributes expects the real metadata to be present; there is no hook that hands it a decrypted attribute on the fly. So encryption is only viable for attributes in one of two categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attributes &lt;strong&gt;nothing reads at runtime&lt;/strong&gt; — these can simply be &lt;strong&gt;stripped&lt;/strong&gt;. A build-time &lt;code&gt;[Obsolete]&lt;/code&gt; message, an internal marker read only by tooling, a documentation hint: the compiler has already consumed what it needed, and the row is dead weight that only leaks intent. Delete it.&lt;/li&gt;
&lt;li&gt;Attributes &lt;strong&gt;your own application reads through a Nebula-provided accessor&lt;/strong&gt; — these can have their blob &lt;strong&gt;encrypted&lt;/strong&gt; and be rebuilt on demand. Because your read site is under Nebula's control, it can be rewritten to decrypt and reconstruct.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else is &lt;strong&gt;kept verbatim&lt;/strong&gt;. This is a policy-driven, scoped transform, not a switch that encrypts every attribute in the assembly.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;Each CustomAttribute row is classified by policy: framework-consumed attributes are kept verbatim, attributes nothing reads at runtime are stripped, and only attributes the app reads through a Nebula accessor have their blob encrypted and rebuilt lazily at runtime.&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Stripping and encrypting, concretely
&lt;/h2&gt;

&lt;p&gt;For the &lt;strong&gt;strip&lt;/strong&gt; case there is nothing to reconstruct. Nebula removes the &lt;code&gt;CustomAttribute&lt;/code&gt; row and, if the blob was the only thing pointing into a &lt;code&gt;#Blob&lt;/code&gt; or &lt;code&gt;#Strings&lt;/code&gt; entry, that data goes too. The &lt;code&gt;[Obsolete]&lt;/code&gt; message that only ever mattered at compile time is gone from the shipped binary: a reader sees a method with no attribute, not a method whose attribute confesses what it replaced.&lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;encrypt&lt;/strong&gt; case the row is rewritten so its blob is ciphertext (or the row is removed and the data stored as an encrypted side blob keyed by target), and every site in your code that read the attribute is redirected to a generated accessor. Conceptually, the before:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;attr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetCustomAttribute&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;RouteAttribute&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;attr&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Template&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;        &lt;span class="c1"&gt;// "/internal/vault/migrate"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;becomes a call Nebula injects in its place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Nebula-generated accessor; blob names and key material are string-encrypted.&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ProtectedAttributes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetRoute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;methodToken&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Template&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the accessor itself decrypts the stored blob and reconstructs the value on demand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ProtectedAttributes&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;RouteAttribute&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nc"&gt;GetRoute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;targetToken&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;_blobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;TryGetValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;targetToken&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;out&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cipher&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;clear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cipher&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;DeriveKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// key derived, not stored&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;RouteAttribute&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nc"&gt;RebuildAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// prolog → ctor args → named args&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;RebuildAttribute&lt;/code&gt; runs exactly the decode the blob format demands — read the prolog, pull the fixed arguments in constructor-signature order, read &lt;code&gt;NumNamed&lt;/code&gt;, then bind each &lt;code&gt;FIELD&lt;/code&gt;/&lt;code&gt;PROPERTY&lt;/code&gt; named argument — and calls the constructor and setters to produce a live instance. The route template &lt;code&gt;"/internal/vault/migrate"&lt;/code&gt; never appears as a plaintext &lt;code&gt;SerString&lt;/code&gt; in the file; it exists only after the accessor has decrypted and rebuilt it, in memory, at the moment your code asks.&lt;/p&gt;

&lt;h2&gt;
  
  
  How you drive it
&lt;/h2&gt;

&lt;p&gt;In practice this is a policy, not per-attribute surgery. Nebula ships a conservative default that keeps every attribute the runtime or a known framework is likely to read, and you extend it with an allow/deny list: strip attribute types that are pure compile-time or tooling hints, mark the attribute types your own code reads through the accessor for encryption, and leave the rest alone. The matching is by attribute &lt;em&gt;type&lt;/em&gt;, so &lt;code&gt;[Obsolete]&lt;/code&gt; across the whole assembly is one decision, not hundreds. See the &lt;a href="https://delta1labs.com/docs/nebula/" rel="noopener noreferrer"&gt;docs&lt;/a&gt; for the &lt;code&gt;nebula.config.json&lt;/code&gt; attribute-policy reference, and &lt;a href="https://delta1labs.com/products/nebula" rel="noopener noreferrer"&gt;Nebula.NET&lt;/a&gt; for how this sits alongside string and resource encryption.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it leaks, and when it breaks
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The key is reachable, so this raises cost, not a wall.&lt;/strong&gt; Same honest caveat as string encryption: to decrypt at runtime the key must be derivable at runtime, so it is present, in some form, in the shipped assembly, and the reconstructed attribute is a live object in memory once your code reads it. An attacker who runs the program and dumps the process after the accessor fires can recover the value. What encryption defeats is the one-click static read — decode the blob, read the message off the disk. That becomes a dynamic attack against obfuscated, string-encrypted code. Pair it with &lt;a href="https://delta1labs.com/blog/nebula-string-decryption-hot-path-cost-and-scoping" rel="noopener noreferrer"&gt;string encryption&lt;/a&gt; so the key material and the blob map are not themselves plaintext literals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encrypt a framework-consumed attribute and you break the app, not just its obfuscation.&lt;/strong&gt; This bears repeating because it is the way this transform fails in production: the compile is green, and type load throws — or worse, marshalling silently changes. Keep the policy conservative. If a serializer, DI container, validation framework, or the runtime itself reads an attribute, keep it verbatim; only strip or encrypt attributes you have confirmed are read solely at compile time or solely through your own accessor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reflection over your encrypted attribute returns nothing.&lt;/strong&gt; Because the real &lt;code&gt;CustomAttribute&lt;/code&gt; row is gone or its blob is ciphertext, &lt;code&gt;Type.GetCustomAttributes&lt;/code&gt; will not find the attribute for third-party code — that is the point, but it means any legitimate reflective consumer you forgot about also comes up empty. Only encrypt attributes whose read path you own and have rerouted through the accessor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;Renaming scrubs the &lt;code&gt;#Strings&lt;/code&gt; heap and leaves the &lt;code&gt;#Blob&lt;/code&gt; heap untouched, so every attribute argument — an &lt;code&gt;[Obsolete]&lt;/code&gt; message, a DI marker, an &lt;code&gt;InternalsVisibleTo&lt;/code&gt; target — survives verbatim and leaks the design it describes. The fix is not to encrypt all attributes; it is a keep/strip/encrypt policy. Keep what the CLR, JIT, loader, and frameworks read. Strip what nothing reads at runtime. Encrypt the blobs of the few attributes your own code reads through a Nebula-generated accessor, and rebuild them on demand with a derived key. Scoped that way — away from anything the runtime consumes, toward the attributes that actually carry your intent — it closes a leak that renaming alone was never able to reach.&lt;/p&gt;

</description>
      <category>nebulanet</category>
      <category>obfuscation</category>
      <category>metadata</category>
    </item>
    <item>
      <title>Trading a license for short-lived tokens</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 20:10:40 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/trading-a-license-for-short-lived-tokens-ig6</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/trading-a-license-for-short-lived-tokens-ig6</guid>
      <description>&lt;p&gt;A signed license is the right object to prove what a customer bought and the wrong object to hand a downstream service on every request. It is large. It carries the whole purchase — seats, editions, renewal terms — when the service checking it only wants to know one thing. And if every service verifies it by asking the license server, that server is suddenly on the hot path of every request in your system, which is precisely where a licensing component should never be.&lt;/p&gt;

&lt;p&gt;The instinct is to cache the answer. But a cache of "is this license valid" is a revocation problem in disguise: the moment you cache, you have to decide how stale an answer you will tolerate, and you are back to distributing freshness. There is a cleaner shape, and the identity world already settled on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real question
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc8693" rel="noopener noreferrer"&gt;RFC 8693&lt;/a&gt; describes OAuth &lt;strong&gt;token exchange&lt;/strong&gt;: a client presents one token and receives another, narrower one, minted for a specific purpose. Licensing has the same shape. The client presents its long-lived signed license &lt;strong&gt;once&lt;/strong&gt; to a token-exchange endpoint and gets back a short-lived &lt;strong&gt;capability token&lt;/strong&gt; — a tiny signed object carrying only the scopes one service needs, an audience naming that service, and an &lt;code&gt;exp&lt;/code&gt; a few minutes out. Each service verifies that small token offline with a pinned public key. The license server mints and then disappears from the request path.&lt;/p&gt;

&lt;p&gt;The question this post answers is how to build that mint and that offline verify so the crypto is actually correct — and what you give up to keep the license server off the hot path.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;The license is presented once and projected down to a short-lived, narrowly-scoped capability token. Each service verifies that token offline — signature, audience, expiry — and never calls the license server, which is why revocation latency equals the token lifetime.&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A real ES256 token
&lt;/h2&gt;

&lt;p&gt;The capability token is a compact JWS: &lt;code&gt;base64url(header).base64url(payload).base64url(signature)&lt;/code&gt;. The signature algorithm is &lt;strong&gt;ES256&lt;/strong&gt; — ECDSA over the NIST P-256 curve with SHA-256 — because the .NET base class library ships it. (Ed25519 would be a fine choice too, but there is no Ed25519 in &lt;code&gt;System.Security.Cryptography&lt;/code&gt;; you would reach for NSec or BouncyCastle. ECDSA keeps every line below copy-paste real against the BCL.)&lt;/p&gt;

&lt;p&gt;The one subtlety that trips people up: JWS does &lt;strong&gt;not&lt;/strong&gt; use a DER-encoded ECDSA signature. It uses the raw fixed-width &lt;code&gt;r‖s&lt;/code&gt; concatenation, which the BCL calls &lt;code&gt;DSASignatureFormat.IeeeP1363FixedFieldConcatenation&lt;/code&gt;. Get that wrong and your tokens will not verify against any standard JWT library. Two tiny helpers handle the base64url dialect (no padding, URL-safe alphabet):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;B64Url&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nc"&gt;Encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ReadOnlySpan&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="nc"&gt;Convert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToBase64String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;TrimEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'='&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'+'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'-'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'_'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nc"&gt;Decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'-'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'+'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'_'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Length&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"=="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Convert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FromBase64String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Minting: present the license, get a capability
&lt;/h2&gt;

&lt;p&gt;The exchange endpoint is the only component that holds the private key. It verifies the presented license, derives the scopes for the one service the caller is headed to, and signs a token that expires in minutes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;sealed&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TokenMint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ECDsa&lt;/span&gt; &lt;span class="n"&gt;signingKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;keyId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;issuer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nc"&gt;Exchange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;License&lt;/span&gt; &lt;span class="n"&gt;license&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;audience&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TimeSpan&lt;/span&gt; &lt;span class="n"&gt;lifetime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DateTimeOffset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;UtcNow&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dictionary&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"alg"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ES256"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"typ"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"at+jwt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"kid"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;keyId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;             &lt;span class="c1"&gt;// tells the verifier which public key&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dictionary&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"iss"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;issuer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"aud"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;audience&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;        &lt;span class="c1"&gt;// the ONE service this token is for&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"iat"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToUnixTimeSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"exp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lifetime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToUnixTimeSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"jti"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NewGuid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ScopesFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;license&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;audience&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;signingInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
            $&lt;span class="s2"&gt;"{B64Url.Encode(JsonSerializer.SerializeToUtf8Bytes(header))}."&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
            $&lt;span class="s2"&gt;"{B64Url.Encode(JsonSerializer.SerializeToUtf8Bytes(payload))}"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;// ES256 = ECDSA/P-256/SHA-256 with the JWS r‖s signature layout.&lt;/span&gt;
        &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;signingKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SignData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nc"&gt;Encoding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ASCII&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;signingInput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;HashAlgorithmName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SHA256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;DSASignatureFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IeeeP1363FixedFieldConcatenation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; $&lt;span class="s2"&gt;"{signingInput}.{B64Url.Encode(sig)}"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Project the long-lived entitlements down to what THIS service may do.&lt;/span&gt;
    &lt;span class="c1"&gt;// The keys are generic, vendor-chosen examples — not any product's internals.&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;IEnumerable&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;ScopesFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;License&lt;/span&gt; &lt;span class="n"&gt;license&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;audience&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="n"&gt;license&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Entitlements&lt;/span&gt;
               &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AppliesTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;audience&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
               &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Scope&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// e.g. "export.pdf", "seats:5"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The license itself is verified first, exactly once, with its own long-lived key — the same canonical-bytes signature check you already run. Everything the mint emits after that is derived: the token says nothing the license did not already grant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying: offline, one signature, no call home
&lt;/h2&gt;

&lt;p&gt;Each downstream service holds only the &lt;strong&gt;public&lt;/strong&gt; half of the signing key, pinned, plus its own name. Verification is four checks and zero network.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nc"&gt;TryVerify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ECDsa&lt;/span&gt; &lt;span class="n"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;expectedAudience&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;TimeProvider&lt;/span&gt; &lt;span class="n"&gt;clock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;out&lt;/span&gt; &lt;span class="nc"&gt;Capability&lt;/span&gt; &lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;cap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'.'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Length&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// 1. Signature over the EXACT bytes that were signed — header.payload.&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;signingInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Encoding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ASCII&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;$&lt;span class="s2"&gt;"{p[0]}.{p[1]}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;B64Url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;VerifyData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;signingInput&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;HashAlgorithmName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SHA256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;DSASignatureFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IeeeP1363FixedFieldConcatenation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// 2. Only parse claims once the signature holds.&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;JsonDocument&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;B64Url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RootElement&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// 3. Audience must name THIS service — not some other one.&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"aud"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;expectedAudience&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// 4. Freshness, with a small symmetric clock-skew leeway.&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;clock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetUtcNow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;exp&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DateTimeOffset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FromUnixTimeSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"exp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetInt64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;iat&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DateTimeOffset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FromUnixTimeSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"iat"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetInt64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;skew&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;TimeSpan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FromSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;exp&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;skew&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;iat&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;skew&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;cap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Capability&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nc"&gt;Scopes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                 &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;StringSplitOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RemoveEmptyEntries&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nc"&gt;Expires&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Signature before claims is not a stylistic choice — reading &lt;code&gt;aud&lt;/code&gt; or &lt;code&gt;scope&lt;/code&gt; out of an unverified token means acting on attacker-controlled JSON. &lt;code&gt;VerifyData&lt;/code&gt; with the matching &lt;code&gt;DSASignatureFormat&lt;/code&gt; returns &lt;code&gt;false&lt;/code&gt; for any token not signed by the private key, so nothing past step 1 runs on a forged token. The public key is loaded once at startup, for example from a pinned SubjectPublicKeyInfo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;publicKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ECDsa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ImportSubjectPublicKeyInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pinnedSpki&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;out&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A service then enforces a capability by asking the parsed token, never the network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nc"&gt;TryVerify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bearer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"report-service"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TimeProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;out&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Scopes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"export.pdf"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Forbid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Caveats, and the one that defines the design
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Revocation latency equals the token lifetime.&lt;/strong&gt; This is the price, stated plainly. Because the services never call the license server, a revoked license keeps working at every service until the last capability token it minted expires. A five-minute lifetime means a cancelled or downgraded license can keep acting for up to five minutes. You cannot have both zero per-request round-trips and instant revocation — the lifetime is the dial between them. Choose it for the worst revocation you genuinely need to act on: seconds if a charge-back must bite immediately, a few minutes if human-scale latency is fine and you want fewer mints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clock skew cuts both ways.&lt;/strong&gt; Freshness is a time comparison, so a verifier whose clock is wrong will accept an expired token or reject a valid one. The symmetric 30-second leeway above absorbs normal drift; it does not save a machine whose clock is wildly wrong, which is the same exposure every expiry-based check carries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The public key has to be distributed and rotated.&lt;/strong&gt; Verifiers pin the public key, so rotating the signing key means shipping a new public key and keeping the previous one accepted for an overlap window at least as long as the token lifetime, so tokens already in flight still verify. The &lt;code&gt;kid&lt;/code&gt; header is what lets a verifier hold several public keys at once and pick the right one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A still-valid token can be replayed.&lt;/strong&gt; Within its short lifetime, a captured token works wherever its &lt;code&gt;aud&lt;/code&gt; points. That is exactly why &lt;code&gt;aud&lt;/code&gt; names one service and &lt;code&gt;scope&lt;/code&gt; is as narrow as the service needs: a leaked token reaches only the one audience it was minted for and only the capabilities already granted there. Short lifetime, narrow audience, narrow scope — those three are the whole containment story, and &lt;code&gt;jti&lt;/code&gt; lets a service that wants belt-and-braces keep a short replay-cache keyed on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;A long-lived license answers "what did this customer buy?" — a slow-changing, high-value fact that belongs under a key you guard closely. A downstream service asks a smaller, faster question: "may this request export a PDF in the next few minutes?" Token exchange lets you answer the second without dragging the first onto the hot path. Present the license once, mint a tiny ES256 capability token scoped to one audience, and let every service verify it offline against a pinned public key. The only thing you trade away is instant revocation — and because the token lifetime is a number you set deliberately, that trade is yours to make rather than the network's to impose.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://delta1labs.com/products/keyright" rel="noopener noreferrer"&gt;Keyright&lt;/a&gt; ships the signing and verification primitives, including the ECDSA token helpers above; the &lt;a href="https://delta1labs.com/docs/keyright/" rel="noopener noreferrer"&gt;docs&lt;/a&gt; cover wiring the exchange endpoint and pinning verifier keys. The free Community Edition verifies tokens; minting and scope derivation are enforcement features of the paid editions.&lt;/p&gt;

</description>
      <category>keyright</category>
      <category>licensing</category>
      <category>security</category>
    </item>
    <item>
      <title>Why nameof leaves no trace to decompile</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 20:05:58 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/why-nameof-leaves-no-trace-to-decompile-49j0</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/why-nameof-leaves-no-trace-to-decompile-49j0</guid>
      <description>&lt;p&gt;Write &lt;code&gt;throw new ArgumentNullException(nameof(value))&lt;/code&gt;, compile it, and then decompile the assembly. The &lt;code&gt;nameof&lt;/code&gt; is gone. Not renamed, not obfuscated — &lt;em&gt;gone&lt;/em&gt;, in the sense that there is nothing left in the file that was ever different from the plain string &lt;code&gt;"value"&lt;/code&gt;. This is not a decompiler limitation Glass could fix with a better algorithm. It is a fact about what the C# compiler chose to emit, and it marks one of the hardest, cleanest boundaries in all of decompilation: the line between a construct that leaves evidence and one that leaves a result.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real question
&lt;/h2&gt;

&lt;p&gt;Decompilation is a recovery problem. The compiler lowered your source to IL and metadata, and the decompiler runs that transformation backward. It works as well as it does because most of C# leaves &lt;em&gt;evidence&lt;/em&gt; — a &lt;code&gt;typeof&lt;/code&gt; leaves a token that names a type, a &lt;code&gt;foreach&lt;/code&gt; leaves a recognizable call pattern, a &lt;code&gt;lock&lt;/code&gt; leaves a &lt;code&gt;try/finally&lt;/code&gt; around &lt;code&gt;Monitor.Enter&lt;/code&gt;. The decompiler matches the shape and rebuilds the source.&lt;/p&gt;

&lt;p&gt;So the question for &lt;code&gt;nameof&lt;/code&gt; is simply: what evidence does it leave? And the uncomfortable answer is &lt;em&gt;none&lt;/em&gt;. &lt;code&gt;nameof(value)&lt;/code&gt; does not lower to a shape. It lowers to a value — the string &lt;code&gt;"value"&lt;/code&gt; — and that value is indistinguishable from any other string with the same characters. There is nothing to match on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mechanism, shown
&lt;/h2&gt;

&lt;p&gt;Put the two forms side by side in one method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;Check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;object&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The C# compiler emits this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ldstr      "value"
stloc.0
ldstr      "value"
stloc.1
ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two &lt;code&gt;ldstr&lt;/code&gt; instructions, identical operands. The first came from &lt;code&gt;nameof(value)&lt;/code&gt;; the second from the literal &lt;code&gt;"value"&lt;/code&gt;. Nothing in the instruction stream tells them apart. There is no custom modifier on the local, no attribute on the method, no entry in any metadata table that records "slot 0 was a nameof." The reason is in the C# language specification: &lt;code&gt;nameof&lt;/code&gt; is a &lt;em&gt;constant expression&lt;/em&gt; of type &lt;code&gt;string&lt;/code&gt;. The compiler is required to evaluate it at compile time and substitute the resulting constant — the same way it folds &lt;code&gt;2 + 2&lt;/code&gt; to &lt;code&gt;4&lt;/code&gt;. By the time the bytes are written, a &lt;code&gt;nameof&lt;/code&gt; is as absent from the program as the &lt;code&gt;+&lt;/code&gt; in a folded arithmetic constant.&lt;/p&gt;

&lt;p&gt;It gets one notch more total. The &lt;code&gt;ldstr&lt;/code&gt; operand is not even the string — it is a token into the &lt;code&gt;#US&lt;/code&gt; (user-string) heap, where string literals live. The compiler &lt;em&gt;deduplicates&lt;/em&gt; that heap. So &lt;code&gt;nameof(value)&lt;/code&gt; and &lt;code&gt;"value"&lt;/code&gt; do not merely compile to the same instruction; they compile to the same &lt;code&gt;0x70&lt;/code&gt; token pointing at the same single entry in &lt;code&gt;#US&lt;/code&gt;. There is physically one copy of &lt;code&gt;"value"&lt;/code&gt; in the file, and both source expressions point at it.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;Both source forms fold to one constant, one ldstr, one deduplicated #US entry. The decompiler sees a single string with no record of its origin, so the faithful output is the literal.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Contrast this with &lt;code&gt;typeof&lt;/code&gt;, which decompiles exactly. &lt;code&gt;typeof(Customer)&lt;/code&gt; lowers to &lt;code&gt;ldtoken&lt;/code&gt; plus a call to &lt;code&gt;Type.GetTypeFromHandle&lt;/code&gt;, and the &lt;code&gt;ldtoken&lt;/code&gt; operand is a &lt;em&gt;metadata token&lt;/em&gt; that names the type. The evidence survives: the shape (the instruction pair) and the content (the token) are both still there. &lt;code&gt;nameof&lt;/code&gt; keeps neither. It has no distinctive shape — a single &lt;code&gt;ldstr&lt;/code&gt; is the most common instruction in most assemblies — and no distinctive content, because the content is a plain string that any literal could also have produced.&lt;/p&gt;

&lt;h2&gt;
  
  
  The line this draws, precisely
&lt;/h2&gt;

&lt;p&gt;The useful lesson is not "nameof is lost." It is &lt;em&gt;why&lt;/em&gt; it is lost, because the same reasoning sorts every construct in the language into recoverable and unrecoverable.&lt;/p&gt;

&lt;p&gt;A construct is recoverable when the compiler stores it as &lt;strong&gt;structured metadata&lt;/strong&gt;: a token, a typed blob, a table row. It is unrecoverable when the compiler &lt;strong&gt;folds it into a plain value&lt;/strong&gt; that is indistinguishable from other sources of the same value.&lt;/p&gt;

&lt;p&gt;By that test, &lt;code&gt;[CallerMemberName]&lt;/code&gt; lands on exactly the same side as &lt;code&gt;nameof&lt;/code&gt;. Write this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;Raise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;CallerMemberName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="nc"&gt;PropertyChanged&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PropertyChangedEventArgs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// at the call site, inside a property setter named Total:&lt;/span&gt;
&lt;span class="nc"&gt;Raise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The attribute lives on the &lt;em&gt;parameter&lt;/em&gt; in metadata — that part is preserved — but its effect is at the &lt;em&gt;call site&lt;/em&gt;, and there the compiler simply bakes in a literal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight llvm"&gt;&lt;code&gt;&lt;span class="n"&gt;ldstr&lt;/span&gt;      &lt;span class="s2"&gt;"Total"&lt;/span&gt;
&lt;span class="k"&gt;call&lt;/span&gt;       &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;MyType&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Raise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The call site shows &lt;code&gt;ldstr "Total"&lt;/code&gt; with no trace of &lt;code&gt;[CallerMemberName]&lt;/code&gt;, no trace of the defaulted argument, nothing. A decompiler reading only that method sees a bare string being passed and will — correctly, faithfully — render &lt;code&gt;Raise("Total")&lt;/code&gt;. The compiler baked a string; the decompiler cannot un-bake it. Same category as &lt;code&gt;nameof&lt;/code&gt;: &lt;em&gt;the source form was consumed to produce a value&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Now the other side of the line. A custom attribute argument looks superficially similar — it is "just data" — but it is stored completely differently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Obsolete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"use TryParse"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nc"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the arguments &lt;code&gt;"use TryParse"&lt;/code&gt; and &lt;code&gt;true&lt;/code&gt; are serialized into the &lt;code&gt;#Blob&lt;/code&gt; heap as a &lt;em&gt;typed&lt;/em&gt; custom-attribute value blob: a prolog, then each argument tagged with its element type. The blob records that the first argument is a &lt;code&gt;string&lt;/code&gt; and the second a &lt;code&gt;bool&lt;/code&gt;. That structure is evidence. Glass reads the blob, knows the kinds, and reconstructs &lt;code&gt;[Obsolete("use TryParse", true)]&lt;/code&gt; exactly — including the fact that &lt;code&gt;true&lt;/code&gt; is a boolean, not the string &lt;code&gt;"true"&lt;/code&gt;. An enum argument keeps its underlying constant and its enum type reference; a &lt;code&gt;typeof&lt;/code&gt; argument keeps its token. All of it survives because the compiler chose to store it structurally instead of folding it into an opaque value.&lt;/p&gt;

&lt;p&gt;That is the whole boundary. &lt;code&gt;nameof&lt;/code&gt; and &lt;code&gt;[CallerMemberName]&lt;/code&gt; bake strings; attribute arguments, &lt;code&gt;typeof&lt;/code&gt;, and enum constants keep structure. Recovery is possible precisely when, and only when, structure survives.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Glass handles it
&lt;/h2&gt;

&lt;p&gt;Glass decompiles the &lt;code&gt;ldstr&lt;/code&gt; to the string literal. That is the faithful answer and the default, because it is the only output that is provably true to the IL. Rendering &lt;code&gt;nameof(value)&lt;/code&gt; instead would be a claim the file does not support.&lt;/p&gt;

&lt;p&gt;Glass can &lt;em&gt;optionally&lt;/em&gt; annotate a string literal as a candidate &lt;code&gt;nameof&lt;/code&gt; when the literal exactly matches an identifier that is in scope and used nearby in a recognized pattern — the argument to &lt;code&gt;ArgumentNullException.ThrowIfNull&lt;/code&gt;, an &lt;code&gt;OnPropertyChanged&lt;/code&gt; call, a logging scope key. When you enable that, Glass shows the literal and attaches a note that it &lt;em&gt;could&lt;/em&gt; have been &lt;code&gt;nameof&lt;/code&gt;. It never silently rewrites the string into &lt;code&gt;nameof&lt;/code&gt;, and the note is always marked as a heuristic.&lt;/p&gt;

&lt;p&gt;The distinction matters because the heuristic is a guess about the source, not a recovery of it. A literal that happens to equal an identifier is not necessarily a &lt;code&gt;nameof&lt;/code&gt; — &lt;code&gt;throw new ArgumentException("value")&lt;/code&gt; where &lt;code&gt;"value"&lt;/code&gt; is a human-readable message that coincides with a parameter name is a real and common case, and rewriting it to &lt;code&gt;nameof(value)&lt;/code&gt; would be wrong. Being wrong here is not a cosmetic slip; it changes what the reader believes the author wrote. So Glass draws the faithful string by default and treats any &lt;code&gt;nameof&lt;/code&gt; rendering as an annotation you opt into, never as a fact it recovered. You can read more about Glass and its decompilation model at &lt;a href="https://delta1labs.com/products/glass" rel="noopener noreferrer"&gt;/products/glass&lt;/a&gt; and in the &lt;a href="https://delta1labs.com/docs/glass/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  When it breaks — and it is not Glass that breaks
&lt;/h2&gt;

&lt;p&gt;The honest framing is that there is no fix. No decompiler, however good, can distinguish &lt;code&gt;nameof(value)&lt;/code&gt; from &lt;code&gt;"value"&lt;/code&gt;, because &lt;em&gt;the information does not exist in the file&lt;/em&gt;. This is not a gap in Glass's pattern library that a future release closes. It is a one-way transformation the compiler performed, and the only artifact that could tell you the source form — the source — is exactly what you do not have.&lt;/p&gt;

&lt;p&gt;The practical consequences are small but worth knowing. If you decompile a library to study how it validates arguments, the &lt;code&gt;nameof&lt;/code&gt; calls you see in the original source will read back as string literals (possibly annotated). Refactoring tools that rely on &lt;code&gt;nameof&lt;/code&gt; to keep a string in sync with an identifier give you no signal in decompiled code, because the link is gone. And if you are comparing two builds to see what changed, a literal and a &lt;code&gt;nameof&lt;/code&gt; of the same text are — correctly — identical, so a source edit from one to the other is invisible in the IL. In every case the right mental model is the same: you are looking at the &lt;em&gt;result&lt;/em&gt; of &lt;code&gt;nameof&lt;/code&gt;, and the operation that produced it left no return address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;nameof(x)&lt;/code&gt; is a compile-time constant. It evaluates to the string &lt;code&gt;"x"&lt;/code&gt; and emits a single &lt;code&gt;ldstr&lt;/code&gt; — the same token, pointing at the same deduplicated &lt;code&gt;#US&lt;/code&gt; entry, that the literal &lt;code&gt;"x"&lt;/code&gt; produces. Nothing distinguishes them, so a faithful decompiler shows the literal and treats any &lt;code&gt;nameof&lt;/code&gt; rendering as a heuristic annotation, never a recovery. The deeper lesson is the boundary it reveals: a construct is recoverable exactly when the compiler stored it as structure — a token, a typed blob, a table row — and unrecoverable when it folded it into a value. &lt;code&gt;nameof&lt;/code&gt; and &lt;code&gt;[CallerMemberName]&lt;/code&gt; fold; &lt;code&gt;typeof&lt;/code&gt; and attribute arguments keep structure. Learn to read which side of that line a construct falls on, and you will always know how much to trust what the decompiler shows you.&lt;/p&gt;

</description>
      <category>glassnet</category>
      <category>decompilation</category>
      <category>csharp</category>
      <category>il</category>
    </item>
    <item>
      <title>Fusing integrity checks into real computation</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 08:12:27 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/fusing-integrity-checks-into-real-computation-3bda</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/fusing-integrity-checks-into-real-computation-3bda</guid>
      <description>&lt;p&gt;Rename everything, encrypt every string, and the cheapest attack on a managed assembly is still a one-byte IL patch. The usual defence is a self-integrity check: hash your own method bodies at runtime, compare against a value baked in at protect time, and call a tamper handler if they differ. It works — until the attacker opens the assembly, finds the comparison, and deletes it. The whole defence lives behind one conditional branch, and that branch is a detachable part: NOP it and the program runs patched and content. This post is about a different shape of the same idea — one with no branch to find. Instead of comparing the checksum, you &lt;em&gt;use&lt;/em&gt; it: derive a value the program genuinely needs from a hash of your protected method bodies, so that patching any byte silently corrupts that value and the program produces garbage, with no isolated failure path to locate and remove.&lt;/p&gt;

&lt;h2&gt;
  
  
  The weak version: detect and branch
&lt;/h2&gt;

&lt;p&gt;Here is the honest baseline — a self-check written the obvious way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;VerifyIntegrity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;actual&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;GuardedMethodBodies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// hash my own IL&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;actual&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SequenceEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Expected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;             &lt;span class="c1"&gt;// Expected baked in at protect time&lt;/span&gt;
        &lt;span class="nc"&gt;TamperResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Trigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                    &lt;span class="c1"&gt;// the detachable part&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem is the shape, not the hash. Compiled, the decision is a single conditional:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IL_0014: call      bool [App]App.Integrity::SequenceEqual(uint8[], uint8[])
IL_0019: brtrue.s  IL_0020      // equal -&amp;gt; skip the response
IL_001b: call      void [App]App.TamperResponse::Trigger()
IL_0020: ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The attacker does not care how good your hash is. They find &lt;code&gt;brtrue.s&lt;/code&gt; (opcode &lt;code&gt;0x2D&lt;/code&gt;) and the &lt;code&gt;Trigger&lt;/code&gt; call, and they have two one-byte moves. Invert the branch to &lt;code&gt;brfalse.s&lt;/code&gt; (&lt;code&gt;0x2C&lt;/code&gt;) and the response only fires on a &lt;em&gt;clean&lt;/em&gt; assembly. Or NOP the three bytes of the &lt;code&gt;call&lt;/code&gt; and it never fires at all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// as shipped
IL_0019: brtrue.s  IL_0020
IL_001b: call      void [App]App.TamperResponse::Trigger()

// after NOPing the response: 0x28 xx xx -&amp;gt; 0x00 0x00 0x00
IL_0019: brtrue.s  IL_0020
IL_001b: nop
IL_001c: nop
IL_001d: nop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hash still computes, still mismatches, and nobody is listening. Everything that follows — delayed reactions, decoupled flags, scattered verifiers — is damage control for one structural fact: a comparison and a response are a &lt;em&gt;separable&lt;/em&gt; thing, and separable things get separated.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real question
&lt;/h2&gt;

&lt;p&gt;What if the integrity value were not something you &lt;em&gt;check&lt;/em&gt; but something you &lt;em&gt;consume&lt;/em&gt;? If the program cannot take a step without the true hash — because the true hash &lt;em&gt;is&lt;/em&gt; the decryption key, or the XOR key for your string table, or an offset it jumps to — then there is nothing to detach. A patch does not trip a branch; it changes the hash, which changes the derived value, which makes the next real operation produce nonsense. The failure is not reported. It is baked into the arithmetic the program already had to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fusing the checksum into a string-decryption key
&lt;/h2&gt;

&lt;p&gt;Take string encryption — a transform you already want. Nebula Pro stores your string literals as an encrypted table and decrypts them on demand with a key. The naive design stores that key as a constant. The fused design &lt;em&gt;derives&lt;/em&gt; it from a checksum of the guarded method bodies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nc"&gt;DeriveStringKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// H over the IL of the methods we froze at protect time.&lt;/span&gt;
    &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;GuardedMethodBodies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// The table was encrypted at protect time under THIS exact value.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                       &lt;span class="c1"&gt;// no comparison, no branch — it is the key&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="no"&gt;S&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DeriveStringKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_stringTable&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&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="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// every string flows through the hash&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At protect time Nebula hashes the final, shipped IL of the guarded methods and encrypts the string table under that digest. There is no &lt;code&gt;Expected&lt;/code&gt; constant anywhere and no &lt;code&gt;if&lt;/code&gt;. The only use of the hash is &lt;em&gt;as the key&lt;/em&gt;. On the bytes you shipped, &lt;code&gt;DeriveStringKey()&lt;/code&gt; reproduces the exact digest the table was encrypted under, every string decrypts correctly, and the program runs. Patch a single byte in any guarded method and the digest changes — so the key is wrong, and every string the program decrypts is garbage. Error messages, format strings, SQL, resource names, config keys: all corrupt, everywhere, with no line that says why.&lt;/p&gt;

&lt;p&gt;Look at what the attacker now finds in the hot path. There is no branch to invert:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// S(int id) — the decrypt path. No brtrue/brfalse anywhere.
IL_0000: call      uint8[] App.Integrity::DeriveStringKey()
IL_0005: stloc.0
IL_0006: ldsfld    uint8[][] App.Strings::_stringTable
IL_000b: ldarg.0
IL_000c: ldelem.ref
IL_000d: ldloc.0
IL_000e: call      string App.Strings::Decrypt(uint8[], uint8[])
IL_0013: ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;de4dot&lt;/code&gt; and &lt;code&gt;dnSpy&lt;/code&gt; are built to defeat the detect-and-branch model: locate the guarding conditional, invert or remove it. Here there is no conditional. The hash result is consumed as data by &lt;code&gt;Decrypt&lt;/code&gt; — ordinary work the program must do to function. To break this an attacker cannot NOP a branch; they must realise the string key is a method-body hash, compute the &lt;em&gt;correct&lt;/em&gt; hash for their patched bytes, and re-embed it so the table decrypts again. The checksum is load-bearing: the program is simply wrong without the true value.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;Left: the checksum feeds a comparison whose branch is a separable part an attacker NOPs out. Right: the same checksum is the decryption key, so there is no branch to remove — a patched byte changes the hash, the key goes wrong, and every decrypted string turns to garbage.&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Other values worth fusing
&lt;/h2&gt;

&lt;p&gt;A string key is the clearest case, but any value the program derives at runtime is a candidate. Fold the checksum into it with an operation that is the identity on the true hash and noise on anything else:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// A numeric constant the program needs — correct only when H matches the baked-in digest.&lt;/span&gt;
&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nc"&gt;ShardCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;h32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BitConverter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToInt32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;GuardedMethodBodies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// At protect time: Mask was chosen so (h32 ^ Mask) == the real shard count.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;h32&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="nc"&gt;Mask&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;        &lt;span class="c1"&gt;// clean -&amp;gt; 16; patched -&amp;gt; some wrong, non-crashing number&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// A method-body decryption key, tying this post to encrypted bodies:&lt;/span&gt;
&lt;span class="c1"&gt;// the blob for a protected method was encrypted at protect time under H(other guarded bodies).&lt;/span&gt;
&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;GuardedMethodBodies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;il&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BlobFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&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="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// wrong key -&amp;gt; invalid IL -&amp;gt; it never rebuilds&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pattern is always the same: the hash is an &lt;em&gt;input to arithmetic the program already performs&lt;/em&gt;, never the subject of a comparison. Fuse it into a jump offset and a patched assembly jumps somewhere wrong. Fuse it into a cache shard count and buckets scatter. The further the derived value travels from the checksum before it is consumed, the harder it is to see the connection at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  How you turn it on
&lt;/h2&gt;

&lt;p&gt;Fused derivation is part of the &lt;strong&gt;Nebula Pro&lt;/strong&gt; anti-tamper pass, applied post-build so your source never carries the plumbing and the checksum is computed over the &lt;em&gt;final&lt;/em&gt; protected bytes — after renaming, control-flow flattening and string encryption have run. The configuration names are illustrative — treat them as a sketch of the model, not guaranteed flags — but the shape is: you choose a guarded set of method bodies to checksum (&lt;code&gt;integrity.guardedMethods&lt;/code&gt;), and you choose which derived values draw from that checksum (&lt;code&gt;integrity.fuseInto: ["stringKey", "bodyKey"]&lt;/code&gt;), on a &lt;code&gt;nebula protect&lt;/code&gt;-style invocation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nebula protect ./App.dll \
  --integrity-guard &lt;span class="s2"&gt;"App.Licensing.*"&lt;/span&gt; \
  --integrity-fuse stringKey,bodyKey
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checksum the methods where a one-byte patch is the attack — the license gate, the activation guard, the key-derivation routine — and fuse the result into values those same features depend on. Pair it with &lt;code&gt;controlFlow&lt;/code&gt; and &lt;code&gt;encryptStrings&lt;/code&gt; so the derivation itself is not a tidy, readable function. For the string table it feeds, see &lt;a href="https://delta1labs.com/blog/nebula-encrypted-method-bodies-jit-decrypt" rel="noopener noreferrer"&gt;encrypted method bodies and JIT decrypt&lt;/a&gt;; for the detect-and-branch sibling this post deliberately avoids, see &lt;a href="https://delta1labs.com/blog/nebula-self-integrity-hash-check-tamper-response" rel="noopener noreferrer"&gt;how an assembly notices it was patched&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  When it breaks, honestly
&lt;/h2&gt;

&lt;p&gt;Fusing is a layer, not a wall, and it costs you real things.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It is harder to debug — for you, too.&lt;/strong&gt; A fused check has no error message because it has no failure path; when something is wrong the symptom is garbage output far from the cause. A legitimate build problem — a stale checksum, a method edited after the digest was baked — presents as the same silent corruption an attacker would see. Keep your protect step reproducible and your rename map, or you will be the one staring at nonsense with no stack trace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It must be deterministic across the JIT and the platform.&lt;/strong&gt; The checksum has to be a pure function of bytes you froze at protect time. Hash the IL byte arrays or selected metadata blobs — never JIT-compiled native code, JITed addresses, or runtime handles. Those vary legitimately between a debug and release JIT, between x64 and Arm64, between framework versions, and if your fused input moves, your own clean build derives the wrong key. Under ReadyToRun or NativeAOT the IL you hashed may not be what executes; know your deployment model before relying on an IL checksum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is a one-time setup cost and an ordering constraint.&lt;/strong&gt; The checksum must be computed over the &lt;em&gt;final&lt;/em&gt; shipping bytes and the dependent values encrypted under it &lt;em&gt;last&lt;/em&gt;, after every other transform. Get the order wrong and you ship a key derived from a build that never left the machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It is not unbreakable.&lt;/strong&gt; A determined attacker who recognises the derivation can compute the correct hash for their patched bytes and re-embed it, and the table decrypts again. Fusing does not stop that attack; it removes the &lt;em&gt;cheap&lt;/em&gt; one. There is no detachable branch, so the one-byte NOP that beats a naive check accomplishes nothing, and the attacker is forced into a full comprehension of how the value is produced and consumed — redone for every patch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;A tamper check you can point at is a tamper check an attacker can remove. The durable move is to stop checking and start consuming: derive a value the program actually needs — a string key, a body-decryption key, a constant, an offset — from a checksum of your protected method bodies, so the true hash is load-bearing and a patched byte silently corrupts output instead of tripping a branch. It is harder to debug, it demands determinism, and it is not unbreakable — but it deletes the easy attack entirely. See &lt;a href="https://delta1labs.com/products/nebula" rel="noopener noreferrer"&gt;Nebula.NET&lt;/a&gt; for the full transform set, or the &lt;a href="https://delta1labs.com/docs/nebula/" rel="noopener noreferrer"&gt;docs&lt;/a&gt; for how the anti-tamper pass fits with the rest of the pipeline.&lt;/p&gt;

</description>
      <category>nebulanet</category>
      <category>antitamper</category>
      <category>security</category>
    </item>
    <item>
      <title>Binding a license to a TPM-protected key</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 08:11:09 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/binding-a-license-to-a-tpm-protected-key-kk0</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/binding-a-license-to-a-tpm-protected-key-kk0</guid>
      <description>&lt;p&gt;A bound device key fixes the oldest hole in node-locking: you can copy a license file to a second machine, but you cannot copy the private key it demands a signature from, so the copy fails the challenge. That holds right up until someone reads the key off disk. A software key — even one in DPAPI-protected per-user storage — is a sequence of bytes in a file. Code running as that user can decrypt it, lift it, and clone the device onto a hundred others. Proof-of-possession has moved the attack from "copy a file" to "extract a key," which is progress, but on a compromised machine the key is still extractable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real question
&lt;/h2&gt;

&lt;p&gt;A TPM changes the shape of the answer. The question is no longer &lt;em&gt;where do I hide the key so it is hard to read?&lt;/em&gt; but &lt;em&gt;can I create a key that cannot be read at all — even by code running as the owner — and can I prove to my server that this is such a key?&lt;/em&gt; Those are two distinct claims, and they need two distinct mechanisms. The first is a &lt;strong&gt;non-exportable, hardware-resident key&lt;/strong&gt;: generated inside the TPM, usable for signing, never readable out. The second is &lt;strong&gt;key attestation&lt;/strong&gt;: a signed statement from the chip that the key really is TPM-resident and non-exportable, so the server does not have to take the client's word for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create the key inside the TPM
&lt;/h2&gt;

&lt;p&gt;On Windows, CNG exposes the TPM through a named provider: the &lt;strong&gt;Microsoft Platform Crypto Provider&lt;/strong&gt;. A key created against that provider has its private half generated and held by the chip. Setting &lt;code&gt;ExportPolicy&lt;/code&gt; to &lt;code&gt;None&lt;/code&gt; makes it non-exportable, so there is no API that will ever hand the private key back as bytes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nc"&gt;KeyName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"keyright-device-key"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;CngProvider&lt;/span&gt; &lt;span class="n"&gt;tpm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CngProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MicrosoftPlatformCryptoProvider&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nc"&gt;CngKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;KeyName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tpm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;creationParams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;CngKeyCreationParameters&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Provider&lt;/span&gt;           &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tpm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                        &lt;span class="c1"&gt;// route key material to the TPM&lt;/span&gt;
        &lt;span class="nc"&gt;KeyCreationOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CngKeyCreationOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// per-user key&lt;/span&gt;
        &lt;span class="nc"&gt;ExportPolicy&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CngExportPolicies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="c1"&gt;// private key can never be exported&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// The key pair is generated by the chip; the private half stays inside it.&lt;/span&gt;
    &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;CngKey&lt;/span&gt; &lt;span class="n"&gt;created&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CngKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CngAlgorithm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ECDsaP256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;KeyName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;creationParams&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What leaves the machine at activation is only the public key, and exporting &lt;em&gt;that&lt;/em&gt; is always allowed — the non-exportable policy covers the private half only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;CngKey&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CngKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;KeyName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tpm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;ecdsa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ECDsaCng&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="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;spki&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ecdsa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ExportSubjectPublicKeyInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// public key only — safe to send&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The issuing service binds that public key into the signed license exactly as it would a software device key — it is a claim covered by the vendor signature. Nothing about the &lt;em&gt;binding&lt;/em&gt; changes. What changes is the guarantee behind the private half: it is not in a file, not in the registry, not in your process — it is in the chip.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prove possession by signing a challenge
&lt;/h2&gt;

&lt;p&gt;Possession works the same way it does for a software key, because from the caller's side signing is just &lt;code&gt;SignData&lt;/code&gt;. The difference is underneath: &lt;code&gt;ECDsaCng&lt;/code&gt; does not pull the key into managed memory and sign in software — it cannot, the bytes are not available — it passes the hash to the chip and the chip returns the signature.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Server: a fresh, single-use, short-lived challenge.&lt;/span&gt;
&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;challenge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;RandomNumberGenerator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Client: the TPM signs; the private key never enters process memory.&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;CngKey&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CngKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;KeyName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;CngProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MicrosoftPlatformCryptoProvider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;ecdsa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ECDsaCng&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="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;proof&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ecdsa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SignData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;challenge&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;HashAlgorithmName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SHA256&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is worth looking at the IL, because it shows that the TPM routing is not magic — it is a provider selection resolved at a specific call site. Decompile the signing method and the operative instructions are the provider lookup and the virtual dispatch into the CNG implementation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="n"&gt;hidebysig&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;uint8&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nc"&gt;Sign&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uint8&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;challenge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cil&lt;/span&gt; &lt;span class="n"&gt;managed&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;maxstack&lt;/span&gt;  &lt;span class="mi"&gt;3&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;locals&lt;/span&gt; &lt;span class="n"&gt;init&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CngKey&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ECDsaCng&lt;/span&gt; &lt;span class="n"&gt;ecdsa&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="no"&gt;IL_0000&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ldstr&lt;/span&gt;      &lt;span class="s2"&gt;"keyright-device-key"&lt;/span&gt;
    &lt;span class="no"&gt;IL_0005&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt;       &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CngProvider&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CngProvider&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get_MicrosoftPlatformCryptoProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;IL_000a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt;       &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CngKey&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CngKey&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CngProvider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;IL_000f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;stloc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="no"&gt;IL_0010&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ldloc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="no"&gt;IL_0011&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;newobj&lt;/span&gt;     &lt;span class="n"&gt;instance&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ECDsaCng&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ctor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CngKey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="no"&gt;IL_0016&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;stloc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="no"&gt;IL_0017&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ldloc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="no"&gt;IL_0018&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ldarg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="no"&gt;IL_0019&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt;       &lt;span class="n"&gt;valuetype&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HashAlgorithmName&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HashAlgorithmName&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get_SHA256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;IL_001e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;callvirt&lt;/span&gt;   &lt;span class="n"&gt;instance&lt;/span&gt; &lt;span class="n"&gt;uint8&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ECDsa&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SignData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uint8&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;valuetype&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cryptography&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HashAlgorithmName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="no"&gt;IL_0023&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ret&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;call … get_MicrosoftPlatformCryptoProvider()&lt;/code&gt; is the hinge. Swap it for &lt;code&gt;CngProvider.MicrosoftSoftwareKeyStorageProvider&lt;/code&gt; and the identical managed code signs with a software key instead — same &lt;code&gt;SignData&lt;/code&gt;, same &lt;code&gt;callvirt&lt;/code&gt;, entirely different security property. The &lt;code&gt;callvirt&lt;/code&gt; to &lt;code&gt;ECDsa.SignData&lt;/code&gt; dispatches to the &lt;code&gt;ECDsaCng&lt;/code&gt; override, which marshals the hash into NCrypt and ultimately &lt;code&gt;TPM2_Sign&lt;/code&gt;. The private key is never an operand of any instruction here; it is a handle the chip dereferences on its own side of the boundary.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;Proof-of-possession proves the caller controls the key; attestation proves the key is the chip's. The private key never crosses the dashed boundary — only the signature and the attestation statement do.&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Attestation: proving the key is really in the TPM
&lt;/h2&gt;

&lt;p&gt;Possession has a blind spot. A perfectly honest signature over the challenge proves the caller holds the private key — it says nothing about &lt;em&gt;where&lt;/em&gt; that key lives. A client could create an ordinary software key with &lt;code&gt;MicrosoftSoftwareKeyStorageProvider&lt;/code&gt;, prove possession flawlessly, and the server could not tell the difference. If your goal is only to defeat file copying, that is fine. If your goal is to insist the key is genuinely non-exportable, you need the chip to vouch for it.&lt;/p&gt;

&lt;p&gt;That is what TPM key attestation does. The TPM produces a signed statement — a claim — that a given subject key is resident in the TPM and was created non-exportable, signed under the chip's attestation identity key, which itself chains to the TPM's endorsement key. The server verifies that chain and gains assurance the key it bound is a hardware key, not a software impostor.&lt;/p&gt;

&lt;p&gt;Be honest about the boundary here: &lt;strong&gt;the BCL does not expose key attestation.&lt;/strong&gt; &lt;code&gt;CngKey&lt;/code&gt; lets you create, open, sign and read properties, but there is no managed API that produces an attestation claim. For that you drop to NCrypt via P/Invoke — &lt;code&gt;NCryptCreateClaim&lt;/code&gt; with the platform claim type — and verify the resulting blob server-side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Win32&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SafeHandles&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InteropServices&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Outside the BCL: NCrypt key attestation (ncrypt.dll). There is no managed&lt;/span&gt;
&lt;span class="c1"&gt;// CngKey API for this — the signature below is simplified for illustration.&lt;/span&gt;
&lt;span class="k"&gt;internal&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;NCrypt&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;internal&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="no"&gt;NCRYPT_CLAIM_PLATFORM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x00010000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;LibraryImport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ncrypt.dll"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;internal&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;partial&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nc"&gt;NCryptCreateClaim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nc"&gt;SafeNCryptKeyHandle&lt;/span&gt; &lt;span class="n"&gt;hSubjectKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nc"&gt;SafeNCryptKeyHandle&lt;/span&gt; &lt;span class="n"&gt;hAuthorityKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// the attestation identity key&lt;/span&gt;
        &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="n"&gt;dwClaimType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                     &lt;span class="c1"&gt;// NCRYPT_CLAIM_PLATFORM&lt;/span&gt;
        &lt;span class="nc"&gt;IntPtr&lt;/span&gt; &lt;span class="n"&gt;pParameterList&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;pbClaimBlob&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="n"&gt;cbClaimBlob&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;out&lt;/span&gt; &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="n"&gt;pcbResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="n"&gt;dwFlags&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// The subject key's native handle comes from the CngKey you already created:&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;CngKey&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CngKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"keyright-device-key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;CngProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MicrosoftPlatformCryptoProvider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;SafeNCryptKeyHandle&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Handle&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// feeds hSubjectKey above&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The claim blob travels with the activation request alongside the public key and the possession proof. The server validates the claim's signature up to a trusted attestation authority, confirms it describes the same public key being bound, and only then marks the binding as hardware-backed. This is real work — provisioning the attestation identity key and validating the chain is the bulk of the effort — which is exactly why possession and attestation are kept as separate layers: most vendors want the file-copy defense immediately and add hardware attestation where the threat justifies it.&lt;/p&gt;

&lt;h2&gt;
  
  
  When it still breaks
&lt;/h2&gt;

&lt;p&gt;The honest caveats start with availability. Not every machine has a usable TPM: VMs, older hardware and some locked-down images either have none or expose a virtual TPM. &lt;code&gt;CngKey.Create&lt;/code&gt; against the Platform Crypto Provider throws when there is no usable chip, so hardware binding must be a path you &lt;em&gt;fall back from&lt;/em&gt;, never an assumption. A virtual TPM still yields a key that is non-exportable from inside the guest — useful against in-guest extraction — but its attestation names a software TPM, and you decide whether that clears your bar.&lt;/p&gt;

&lt;p&gt;Then there is the platform wall. Everything above is Windows/CNG. &lt;code&gt;CngKey&lt;/code&gt;, the Platform Crypto Provider and &lt;code&gt;ECDsaCng&lt;/code&gt; throw &lt;code&gt;PlatformNotSupportedException&lt;/code&gt; off Windows. A TPM on Linux is reached through tpm2-tss or the kernel resource manager; the macOS analogue is the Secure Enclave through the Security framework — both outside the BCL. The portable design detects a hardware key store on Windows, falls back to an OS-protected software key elsewhere, and records which kind of key each activation used so the server applies the right trust level rather than pretending every device offers a hardware root.&lt;/p&gt;

&lt;p&gt;Finally, a TPM is not a DRM silver bullet. It protects the &lt;em&gt;key&lt;/em&gt; from extraction; it does not protect the &lt;em&gt;decision&lt;/em&gt; the key gates. A patched client that signs the challenge honestly and then ignores the &lt;code&gt;IsValid&lt;/code&gt; result has defeated nothing cryptographic — it has defeated your control flow. Hardware key binding belongs with fail-closed enforcement and, for distributed binaries, obfuscation of the verification path so the check cannot simply be branched around. Nebula.NET covers that side; see &lt;a href="https://delta1labs.com/products/nebula" rel="noopener noreferrer"&gt;Nebula.NET&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;A software device key stops the license file from being copied. A TPM-protected key stops the &lt;em&gt;key itself&lt;/em&gt; from being copied, by making it a capability the chip exercises on request but never surrenders as bytes. Create it in the Microsoft Platform Crypto Provider with &lt;code&gt;ExportPolicy.None&lt;/code&gt;, bind the public half into the signed license, and prove possession by signing a fresh challenge — all in the BCL on Windows. Add key attestation, through NCrypt, when you need the server to know the key is hardware-resident and not a software stand-in. Be straight with yourself about the limits: Windows-only through the BCL, a real fallback when no TPM exists, and enforcement that still has to hold after the signature checks out.&lt;/p&gt;

&lt;p&gt;Keyright is a self-hosted .NET licensing system — an issuing service plus SDK — with a free &lt;a href="https://delta1labs.com/products/keyright" rel="noopener noreferrer"&gt;Community Edition&lt;/a&gt;. Device binding and the activation handshake are covered in the &lt;a href="https://delta1labs.com/docs/keyright/" rel="noopener noreferrer"&gt;Keyright docs&lt;/a&gt;; for the software-key primitive this hardens, see &lt;a href="https://delta1labs.com/blog/keyright-proof-of-possession-device-key-binding" rel="noopener noreferrer"&gt;proof-of-possession device binding&lt;/a&gt;, and for the hardware-hash approach it complements, &lt;a href="https://delta1labs.com/blog/keyright-machine-fingerprint-node-locking-hardware-drift" rel="noopener noreferrer"&gt;machine fingerprinting and hardware drift&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>keyright</category>
      <category>licensing</category>
      <category>security</category>
    </item>
    <item>
      <title>How Glass reads raw block-copy opcodes</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 08:05:56 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/how-glass-reads-raw-block-copy-opcodes-n8k</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/how-glass-reads-raw-block-copy-opcodes-n8k</guid>
      <description>&lt;p&gt;A method body copies a kilobyte of memory in a single instruction — no loop, no &lt;code&gt;Array.Copy&lt;/code&gt;, no P/Invoke to &lt;code&gt;memcpy&lt;/code&gt;. Three values go on the evaluation stack, one opcode consumes all three, and the block is moved. Another body fills a buffer with a single byte the same way. These are &lt;code&gt;cpblk&lt;/code&gt; and &lt;code&gt;initblk&lt;/code&gt;, the CIL block-memory opcodes, and no C# syntax emits either one. Point a decompiler at a body that contains them and the question is immediate: what readable C# stands in for an instruction the language cannot express? This post walks the exact semantics of both opcodes, their &lt;code&gt;unaligned.&lt;/code&gt; and &lt;code&gt;volatile.&lt;/code&gt; prefixes, and how &lt;a href="https://delta1labs.com/products/glass" rel="noopener noreferrer"&gt;Glass.NET&lt;/a&gt; maps them back to the &lt;code&gt;Unsafe&lt;/code&gt; methods that are the real C# surface — and where it has to stop short and show the raw intrinsic.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real question
&lt;/h2&gt;

&lt;p&gt;C# never compiles any source construct to &lt;code&gt;cpblk&lt;/code&gt; or &lt;code&gt;initblk&lt;/code&gt;. The way those opcodes reach a managed program is &lt;code&gt;System.Runtime.CompilerServices.Unsafe&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Unsafe.CopyBlock&lt;/code&gt; and &lt;code&gt;Unsafe.CopyBlockUnaligned&lt;/code&gt; → &lt;code&gt;cpblk&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Unsafe.InitBlock&lt;/code&gt; and &lt;code&gt;Unsafe.InitBlockUnaligned&lt;/code&gt; → &lt;code&gt;initblk&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But here is the subtlety that shapes the whole decompilation problem: the raw opcode does not appear at &lt;em&gt;your&lt;/em&gt; call site. When you call &lt;code&gt;Unsafe.CopyBlock(...)&lt;/code&gt;, your method's IL carries a plain &lt;code&gt;call&lt;/code&gt; to &lt;code&gt;Unsafe::CopyBlock&lt;/code&gt;. The &lt;code&gt;cpblk&lt;/code&gt; instruction lives inside the body of &lt;code&gt;CopyBlock&lt;/code&gt; itself — a hand-written IL method in the runtime. So a decompiler meets a bare &lt;code&gt;cpblk&lt;/code&gt; in three situations: decompiling the &lt;code&gt;Unsafe&lt;/code&gt; methods' own bodies; decompiling assemblies emitted by &lt;code&gt;ilasm&lt;/code&gt;, an IL rewriter, or a non-C# compiler that wrote the opcode directly; and reading older low-level code that predates &lt;code&gt;Unsafe&lt;/code&gt;. In every one of those, Glass has a raw block opcode and no call wrapping it. The reconstruction target is the &lt;code&gt;Unsafe&lt;/code&gt; call the opcode is the primitive for.&lt;/p&gt;

&lt;h2&gt;
  
  
  cpblk: copy a block
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;cpblk&lt;/code&gt; (byte sequence &lt;code&gt;0xFE 0x17&lt;/code&gt;) copies a run of bytes from one address to another. Its stack transition, from ECMA-335, is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;..., destaddr, srcaddr, size  -&amp;gt;  ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The three operands are pushed in that order, so at the point of the opcode the &lt;strong&gt;byte count&lt;/strong&gt; is on top of the stack, the &lt;strong&gt;source address&lt;/strong&gt; is beneath it, and the &lt;strong&gt;destination address&lt;/strong&gt; is deepest. &lt;code&gt;cpblk&lt;/code&gt; pops all three and copies &lt;code&gt;size&lt;/code&gt; bytes from &lt;code&gt;srcaddr&lt;/code&gt; to &lt;code&gt;destaddr&lt;/code&gt;. It is a straight block move with no overlap handling — the behaviour is &lt;code&gt;memcpy&lt;/code&gt;, not &lt;code&gt;memmove&lt;/code&gt;, so overlapping regions are undefined. The addresses may be managed pointers (&lt;code&gt;&amp;amp;&lt;/code&gt;), unmanaged pointers (&lt;code&gt;*&lt;/code&gt;), or native ints; &lt;code&gt;size&lt;/code&gt; is an &lt;code&gt;unsigned int32&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The body of &lt;code&gt;Unsafe.CopyBlock(ref byte destination, ref byte source, uint byteCount)&lt;/code&gt; is exactly that, nothing more:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ldarg.0      // destination
ldarg.1      // source
ldarg.2      // byteCount
cpblk        // 0xFE 0x17
ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Glass reads that shape — push dest, push src, push size, then &lt;code&gt;cpblk&lt;/code&gt;, with each operand a simple argument or local — and reconstructs the call it is the primitive for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="nc"&gt;Unsafe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CopyBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;byteCount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  initblk: set a block
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;initblk&lt;/code&gt; (&lt;code&gt;0xFE 0x18&lt;/code&gt;) fills a run of bytes with a single value. Its stack transition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;..., destaddr, value, size  -&amp;gt;  ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pushed destination-address, fill-value, byte-count — so the &lt;strong&gt;count&lt;/strong&gt; is on top, the &lt;strong&gt;fill value&lt;/strong&gt; (an &lt;code&gt;unsigned int8&lt;/code&gt;) under it, and the &lt;strong&gt;destination&lt;/strong&gt; deepest. &lt;code&gt;initblk&lt;/code&gt; pops all three and writes the single byte &lt;code&gt;value&lt;/code&gt; into &lt;code&gt;size&lt;/code&gt; bytes starting at &lt;code&gt;destaddr&lt;/code&gt;. This is the IL &lt;code&gt;memset&lt;/code&gt;. The body of &lt;code&gt;Unsafe.InitBlock(ref byte startAddress, byte value, uint byteCount)&lt;/code&gt; mirrors &lt;code&gt;CopyBlock&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ldarg.0      // startAddress
ldarg.1      // value
ldarg.2      // byteCount
initblk      // 0xFE 0x18
ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and Glass renders it back as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="nc"&gt;Unsafe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InitBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;startAddress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;byteCount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two opcodes differ only in their middle operand — &lt;code&gt;cpblk&lt;/code&gt; takes a &lt;em&gt;source address&lt;/em&gt;, &lt;code&gt;initblk&lt;/code&gt; takes a &lt;em&gt;fill byte&lt;/em&gt; — and that single difference is what tells the two &lt;code&gt;Unsafe&lt;/code&gt; methods apart.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;cpblk and initblk pop three stack operands — they differ only in the middle one, a source address versus a fill byte. The unaligned. and volatile. prefixes sit immediately before the opcode and select the Unsafe variant.&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The prefixes: unaligned. and volatile.
&lt;/h2&gt;

&lt;p&gt;Both block opcodes accept the two memory-access prefixes, and they are what distinguish the &lt;code&gt;Unsafe&lt;/code&gt; variants.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;unaligned.&lt;/code&gt; (&lt;code&gt;0xFE 0x12&lt;/code&gt;) carries a single-byte alignment operand — &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;2&lt;/code&gt;, or &lt;code&gt;4&lt;/code&gt; — and warns the JIT that the addresses may not be naturally aligned, so it must not assume alignment when it lowers the copy to platform instructions. This is the only difference between &lt;code&gt;CopyBlockUnaligned&lt;/code&gt; and &lt;code&gt;CopyBlock&lt;/code&gt;. The body of &lt;code&gt;Unsafe.CopyBlockUnaligned&lt;/code&gt; is the &lt;code&gt;CopyBlock&lt;/code&gt; body with one prefix added:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ldarg.0
ldarg.1
ldarg.2
unaligned. 1   // 0xFE 0x12, alignment = 1
cpblk          // 0xFE 0x17
ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Glass reads the &lt;code&gt;unaligned.&lt;/code&gt; prefix sitting in front of the &lt;code&gt;cpblk&lt;/code&gt; and reconstructs the unaligned call rather than the plain one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="nc"&gt;Unsafe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CopyBlockUnaligned&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;byteCount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same prefix in front of &lt;code&gt;initblk&lt;/code&gt; recovers &lt;code&gt;Unsafe.InitBlockUnaligned&lt;/code&gt;. The alignment operand itself is part of the prefix encoding, not a separate stack value, so it never shows as an argument — the presence of the prefix is the whole signal.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;volatile.&lt;/code&gt; (&lt;code&gt;0xFE 0x13&lt;/code&gt;) takes no operand and marks the access as volatile, imposing the ordering and non-elision guarantees of a volatile memory operation. There is no &lt;code&gt;Unsafe&lt;/code&gt; method and no C# construct that produces a &lt;em&gt;volatile&lt;/em&gt; block copy — it is hand-written IL territory. When Glass meets &lt;code&gt;volatile.&lt;/code&gt; in front of a block opcode, it cannot print an honest &lt;code&gt;Unsafe&lt;/code&gt; call that would reproduce it, so it surfaces the prefix as an annotation on the recovered call rather than silently dropping a semantic the author relied on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ldarg.0
ldarg.1
ldarg.2
volatile.      // 0xFE 0x13
cpblk          // 0xFE 0x17
ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// volatile. cpblk — no C# surface; volatile semantics preserved only in IL&lt;/span&gt;
&lt;span class="nc"&gt;Unsafe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CopyBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;byteCount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  A real example
&lt;/h2&gt;

&lt;p&gt;Here is ordinary C# that reaches both opcodes — one filling a span with a byte, one copying between buffers — using the &lt;code&gt;ref&lt;/code&gt;-based overloads so no &lt;code&gt;unsafe&lt;/code&gt; block is needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CompilerServices&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InteropServices&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Blocks&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Zero (or fill) every byte of a span.&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;Fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Span&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;byte&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="nc"&gt;Unsafe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InitBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="nc"&gt;MemoryMarshal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Copy the first `count` bytes of src into dst.&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;Copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Span&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ReadOnlySpan&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="nc"&gt;Unsafe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CopyBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="nc"&gt;MemoryMarshal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="nc"&gt;MemoryMarshal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;em&gt;this&lt;/em&gt; assembly, the IL for &lt;code&gt;Fill&lt;/code&gt; is not an &lt;code&gt;initblk&lt;/code&gt; — it is a &lt;code&gt;call&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ldarg.0
call       !!0&amp;amp; [System.Runtime]System.Runtime.InteropServices.MemoryMarshal::GetReference&amp;lt;uint8&amp;gt;(valuetype [System.Runtime]System.Span`1&amp;lt;!!0&amp;gt;)
ldarg.1
ldarg.0
call       instance int32 valuetype [System.Runtime]System.Span`1&amp;lt;uint8&amp;gt;::get_Length()
call       void [System.Runtime]System.Runtime.CompilerServices.Unsafe::InitBlock(uint8&amp;amp;, uint8, uint32)
ret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;call&lt;/code&gt; decompiles back to &lt;code&gt;Unsafe.InitBlock(...)&lt;/code&gt; trivially — it is already a method call in the metadata. The &lt;em&gt;raw&lt;/em&gt; &lt;code&gt;initblk&lt;/code&gt; is one level down, in the body of &lt;code&gt;Unsafe.InitBlock&lt;/code&gt; itself. So the interesting decompilation happens when Glass opens a body that holds the opcode directly: the runtime's &lt;code&gt;Unsafe&lt;/code&gt; methods, or any assembly whose author wrote the opcode by hand. There, the three-push-then-opcode shape is all Glass has, and it is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the recovery is a guess
&lt;/h2&gt;

&lt;p&gt;The clean mapping holds while the three operands are simple expressions. The honest limits appear when they are not:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Arbitrary pointer math breaks the clean call.&lt;/strong&gt; &lt;code&gt;Unsafe.CopyBlock(ref dest, ref src, size)&lt;/code&gt; is honest only when &lt;code&gt;destaddr&lt;/code&gt; and &lt;code&gt;srcaddr&lt;/code&gt; are single &lt;code&gt;ref&lt;/code&gt;/pointer expressions. When they are the result of unrelated arithmetic — an address built from a base plus a computed offset plus a reinterpret — there is no single &lt;code&gt;ref&lt;/code&gt; sub-expression to hand the method. Glass then keeps the pointer expressions it recovered and prints the intrinsic over them, or, when even that would misstate the IL, annotates the instruction as a raw &lt;code&gt;cpblk&lt;/code&gt;/&lt;code&gt;initblk&lt;/code&gt;. It does not fabricate a &lt;code&gt;ref&lt;/code&gt; that the IL never formed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The call wrapper is already gone at the opcode.&lt;/strong&gt; Because the opcode lives in the &lt;code&gt;Unsafe&lt;/code&gt; body, not the call site, Glass cannot know from the opcode alone &lt;em&gt;which&lt;/em&gt; public overload (&lt;code&gt;void*&lt;/code&gt; vs &lt;code&gt;ref byte&lt;/code&gt;) a distant caller used — the two bodies are identical. It reconstructs the &lt;code&gt;ref&lt;/code&gt;-based form, which is the readable default, and notes the operand kinds it actually saw on the stack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;volatile.&lt;/code&gt; has no C# equivalent.&lt;/strong&gt; A volatile block copy can only be expressed in IL. Glass preserves the fact as a comment on the recovered call; the reconstructed C#, recompiled, would emit a non-volatile &lt;code&gt;cpblk&lt;/code&gt; and lose the guarantee. That is a true round-trip limit, not a rendering choice, and Glass flags it rather than hiding it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alignment is informational, not recoverable as code.&lt;/strong&gt; The &lt;code&gt;unaligned.&lt;/code&gt; operand (&lt;code&gt;1&lt;/code&gt;/&lt;code&gt;2&lt;/code&gt;/&lt;code&gt;4&lt;/code&gt;) selects the &lt;code&gt;*Unaligned&lt;/code&gt; method but the specific alignment value has no place in the C# call — &lt;code&gt;CopyBlockUnaligned&lt;/code&gt; always lowers to &lt;code&gt;unaligned. 1&lt;/code&gt;. Glass records a non-1 alignment it finds as a comment; the C# surface cannot carry it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reading it yourself
&lt;/h2&gt;

&lt;p&gt;Open the assembly in Glass, select a method that does low-level buffer work, and switch between the &lt;strong&gt;C#&lt;/strong&gt; and &lt;strong&gt;IL&lt;/strong&gt; views. In IL you will see the bare skeleton — three pushes (destination, source-or-value, count), any &lt;code&gt;unaligned.&lt;/code&gt;/&lt;code&gt;volatile.&lt;/code&gt; prefix, then &lt;code&gt;cpblk&lt;/code&gt; or &lt;code&gt;initblk&lt;/code&gt;. In C# you will see that collapse into a single &lt;code&gt;Unsafe.CopyBlock&lt;/code&gt;, &lt;code&gt;Unsafe.CopyBlockUnaligned&lt;/code&gt;, &lt;code&gt;Unsafe.InitBlock&lt;/code&gt; or &lt;code&gt;Unsafe.InitBlockUnaligned&lt;/code&gt; call, with the operands in the order the stack held them. Flip between the two on one method and the mapping stops being abstract: the middle stack slot is the whole difference between a copy and a fill, and the prefix in front of the opcode is the whole difference between the aligned and unaligned method.&lt;/p&gt;

&lt;p&gt;Glass.NET is a free .NET decompiler for code you are entitled to inspect — your own assemblies, your dependencies, and third-party binaries you are licensed to analyse. Block-memory opcodes are a good test of a decompiler's honesty: the readable answer is an &lt;code&gt;Unsafe&lt;/code&gt; call, but only when the operands actually form one, and the right move when they do not is to show the primitive rather than a tidy call that was never really there. See &lt;a href="https://delta1labs.com/products/glass" rel="noopener noreferrer"&gt;Glass&lt;/a&gt; and the &lt;a href="https://delta1labs.com/docs/glass/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>glassnet</category>
      <category>decompilation</category>
      <category>csharp</category>
      <category>il</category>
    </item>
    <item>
      <title>Office and home: the same profiles on every computer</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 07:43:31 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/office-and-home-the-same-profiles-on-every-computer-3ih7</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/office-and-home-the-same-profiles-on-every-computer-3ih7</guid>
      <description>&lt;p&gt;A lot of people who run several browser profiles don't sit at one desk. You work from the office three days a week and from home the other two. Or you have a desktop at work and a laptop you take everywhere. Either way, you want the same profiles in both places: signed in to the same accounts, with the same tabs, the same proxy and the same device identity, without copying folders around on a USB stick.&lt;/p&gt;

&lt;p&gt;That is what PassKeel's cloud sync is for. This post walks through the office-and-home routine from the first day, and the details that keep it safe: what happens when you sign in on a second computer, when uploads run, why a profile doesn't download again on the computer that last used it, why signing out waits for uploads, and what PassKeel does when the same profile was used in both places.&lt;/p&gt;

&lt;h2&gt;
  
  
  Day one: sign in on the second computer
&lt;/h2&gt;

&lt;p&gt;Install PassKeel on your home PC and sign in with the same account you use at the office. There's nothing to export or import, and nothing to turn on: sync is &lt;strong&gt;on by default&lt;/strong&gt; while you're signed in, on every plan, including Free.&lt;/p&gt;

&lt;p&gt;Within about a minute, your profiles from the office appear in the list. Their names, groups, tags, notes, settings and proxies come across straight away. The profiles' files (cookies, storage, logins and so on) don't all download at once; each profile shows &lt;strong&gt;In the cloud&lt;/strong&gt; until you open it, and downloads the first time you do. A home computer that only ever opens three of your thirty profiles only downloads those three.&lt;/p&gt;

&lt;p&gt;Each person can use PassKeel on as many of their own computers as they like; computers don't count against your plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  What travels with a profile
&lt;/h2&gt;

&lt;p&gt;A synced profile carries everything that makes it that profile: cookies, local storage and IndexedDB, saved logins, open windows and tabs (so "continue where I left off" works in both places), extension data, its proxy including the password, and every fingerprint setting. Its &lt;strong&gt;PIN lock&lt;/strong&gt; and &lt;strong&gt;hidden&lt;/strong&gt; state travel too, which matters for the &lt;a href="https://passkeel.com/blog/lock-and-hide-profiles-on-shared-computers" rel="noopener noreferrer"&gt;second half of this story&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The device identity stays the same on both computers, including the graphics card a profile reports, even when your home PC has different hardware from the office one. The &lt;a href="https://passkeel.com/docs/profiles/other-computers" rel="noopener noreferrer"&gt;profiles on other computers&lt;/a&gt; page explains what does and doesn't change on different hardware.&lt;/p&gt;

&lt;p&gt;Some things stay on each computer: the extension library (each computer installs extensions), templates, automation recordings and schedules, API keys and app settings. The full table is in &lt;a href="https://passkeel.com/docs/sync/how-it-works#what-is-synced" rel="noopener noreferrer"&gt;how cloud sync works&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The daily routine: nothing to press
&lt;/h2&gt;

&lt;p&gt;You don't press a sync button. PassKeel uploads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a new profile a few seconds after you create it;&lt;/li&gt;
&lt;li&gt;an open profile &lt;strong&gt;when it closes cleanly&lt;/strong&gt;, because that's when its files are complete;&lt;/li&gt;
&lt;li&gt;anything still waiting, about once a minute, most recently used first.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After the first upload, only the parts of a profile that changed are sent, so most syncs are small. Profiles changed on your other computer arrive about once a minute, even with the PassKeel window closed.&lt;/p&gt;

&lt;p&gt;So the routine is simply: work at the office, close your profiles when you're done, go home, open them. Each upload is encrypted on your computer before it leaves; &lt;a href="https://passkeel.com/blog/encrypted-sync-and-hand-over" rel="noopener noreferrer"&gt;how encrypted sync works&lt;/a&gt; covers that, including the recovery trade-off we chose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Forgot to close a profile at the office?
&lt;/h2&gt;

&lt;p&gt;It happens. You get home, open a profile, and PassKeel says it's open on another computer, naming it. A synced profile is open on one computer at a time, because two copies of a cookie database can't be merged safely.&lt;/p&gt;

&lt;p&gt;Choose &lt;strong&gt;Ask to close it there&lt;/strong&gt;. Because both computers are yours, the office PC closes the profile at once, saves it, uploads its changes, and the profile opens at home, usually within a minute. You don't need anyone at the office to do anything, as long as that PC is on and online.&lt;/p&gt;

&lt;p&gt;If the office PC was switched off with the profile still open, it can't answer. After 10 minutes without word from it, PassKeel offers &lt;strong&gt;Take over&lt;/strong&gt;, and the profile opens from its last uploaded version. Changes the office PC never uploaded aren't thrown away; more on that below. The &lt;a href="https://passkeel.com/docs/sync/hand-over" rel="noopener noreferrer"&gt;hand-over guide&lt;/a&gt; has the details.&lt;/p&gt;

&lt;h2&gt;
  
  
  No downloading what you already have
&lt;/h2&gt;

&lt;p&gt;Here's a detail that saves time if your profiles are large. When you open a profile on the computer that last synced it, and nothing newer has been uploaded from anywhere else, PassKeel opens it straight away. It doesn't download the cloud copy over a copy it already has.&lt;/p&gt;

&lt;p&gt;PassKeel checks this against its own record of what this computer last uploaded or downloaded, so it holds even after you've signed out and back in. If your home PC did upload something newer in the meantime, the office PC downloads that newer version when you open the profile, which is what you want.&lt;/p&gt;

&lt;h2&gt;
  
  
  Signing out waits for uploads
&lt;/h2&gt;

&lt;p&gt;Suppose you close a few profiles at the end of the day and sign out of PassKeel straight away. Those profiles' uploads may still be running or waiting for their turn.&lt;/p&gt;

&lt;p&gt;Signing out handles this for you. Open profiles are closed and saved first (the button says &lt;strong&gt;Close and sign out&lt;/strong&gt;), and then PassKeel finishes uploading the closed profiles that are due before it ends the session, waiting for up to two minutes in all. The changes you made at the office are in the cloud when you get home.&lt;/p&gt;

&lt;p&gt;If you sign out of a computer you don't own, see &lt;a href="https://passkeel.com/blog/lock-and-hide-profiles-on-shared-computers#signing-out-of-a-shared-or-office-pc" rel="noopener noreferrer"&gt;signing out of a shared or office PC&lt;/a&gt; for the option that removes your profiles from it.&lt;/p&gt;

&lt;h2&gt;
  
  
  When one profile was used in both places
&lt;/h2&gt;

&lt;p&gt;Hand-over keeps a profile open in one place at a time, so most people never see a conflict. One can still happen when the same profile changed on two computers without either seeing the other's changes. The two usual ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you chose &lt;strong&gt;Open offline&lt;/strong&gt; at home (the sync server couldn't be reached) while the office PC still had the profile;&lt;/li&gt;
&lt;li&gt;you used &lt;strong&gt;Take over&lt;/strong&gt; at home, and later the office PC, which had unsynced changes, came back online.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PassKeel never picks a winner silently. The profile's status becomes &lt;strong&gt;Two versions&lt;/strong&gt;, and its &lt;strong&gt;Sync…&lt;/strong&gt; dialog says "This profile was changed on two computers. We kept both", and which version is in use. Choose &lt;strong&gt;Use this computer's version instead&lt;/strong&gt; or &lt;strong&gt;Use the other version instead&lt;/strong&gt;. The one you choose becomes current on every computer; the other stays in the versions list, so you can switch back. Not sure which is right? Open the profile and check what matters: are you signed in, are the right tabs there?&lt;/p&gt;

&lt;p&gt;Separately, every upload becomes a version you can &lt;strong&gt;Restore&lt;/strong&gt; from the same dialog. See &lt;a href="https://passkeel.com/docs/sync/versions" rel="noopener noreferrer"&gt;versions and conflicts&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A few habits that help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Close profiles before you leave.&lt;/strong&gt; It's not required, thanks to hand-over, but it means the upload happens while you're still at that computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Open offline only when you're sure&lt;/strong&gt; no other computer has the profile. It's there for when the internet is down, and it's the main way to end up with two versions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the office PC online&lt;/strong&gt; if you tend to leave profiles open there, so it can answer a hand-over request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep a profile on one computer&lt;/strong&gt; if it must never leave it: turn off &lt;strong&gt;Sync this profile&lt;/strong&gt; in its &lt;strong&gt;Sync…&lt;/strong&gt; dialog, and its status becomes &lt;strong&gt;Only on this computer&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PassKeel also works offline with profiles already on a computer, as long as it reached its service within the last 72 hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;Carrying profiles everywhere also means they're on more computers, and an office PC isn't always private. The companion post covers that side: &lt;a href="https://passkeel.com/blog/lock-and-hide-profiles-on-shared-computers" rel="noopener noreferrer"&gt;locking, hiding and signing out&lt;/a&gt;. Setting up a new machine? There's a &lt;a href="https://passkeel.com/blog/new-work-computer-checklist" rel="noopener noreferrer"&gt;checklist for a new work computer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>sync</category>
      <category>guides</category>
      <category>multiplecomputers</category>
    </item>
    <item>
      <title>A checklist for setting up PassKeel on a new work computer</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 07:42:58 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/a-checklist-for-setting-up-passkeel-on-a-new-work-computer-58p5</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/a-checklist-for-setting-up-passkeel-on-a-new-work-computer-58p5</guid>
      <description>&lt;p&gt;New computers arrive at awkward times: a replacement office PC, a laptop for working from home, a second desk at a client's site. With cloud sync, most of your PassKeel setup comes across by itself. A few things are deliberately kept per computer, and an old computer should be left clean. Here's the checklist we'd follow.&lt;/p&gt;

&lt;h2&gt;
  
  
  On the new computer
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Install PassKeel.&lt;/strong&gt; &lt;a href="https://passkeel.com/download" rel="noopener noreferrer"&gt;Get it from the Microsoft Store&lt;/a&gt; (or with winget). It includes the Keel browser engine, so there's nothing else to fetch. The &lt;a href="https://passkeel.com/docs/getting-started/install" rel="noopener noreferrer"&gt;install guide&lt;/a&gt; covers the details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Sign in with your usual account.&lt;/strong&gt; Not a new one: each profile belongs to one account, and only that account's profiles come across. If you've turned on two-step sign-in, have your authenticator app ready.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Let your profiles arrive.&lt;/strong&gt; Sync is on by default while you're signed in. Within about a minute your profiles appear; &lt;strong&gt;⋯ &amp;gt; Check for new profiles&lt;/strong&gt; fetches them now if you're impatient. Each shows &lt;strong&gt;In the cloud&lt;/strong&gt; until you first open it, then downloads, so you only download the profiles you actually use on this computer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Check your PIN works.&lt;/strong&gt; Your account PIN is the same on every computer, and locked and hidden profiles stay locked and hidden here too. Open one locked profile to confirm, and use &lt;strong&gt;⋯ &amp;gt; Show hidden profiles…&lt;/strong&gt; if you need the hidden ones. See &lt;a href="https://passkeel.com/docs/profiles/protection" rel="noopener noreferrer"&gt;PIN-locked and hidden profiles&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Add your extensions again.&lt;/strong&gt; The extension library, and which extensions each profile uses, are kept per computer, so install them here and give them to the profiles that need them. The extensions' own data (their settings inside each profile) does sync. See &lt;a href="https://passkeel.com/docs/profiles/extensions" rel="noopener noreferrer"&gt;extensions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Recreate what's per computer.&lt;/strong&gt; Templates, automation recordings and schedules, local API keys and app settings don't sync. If you use the local API from scripts on this computer, create a new API key here rather than copying one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Check the screen and graphics.&lt;/strong&gt; A profile keeps its screen size and the graphics card it reports wherever it opens. If you'll mostly use a profile on this computer and its monitor is a different size, &lt;strong&gt;Fit this monitor&lt;/strong&gt; on the profile's Fingerprint tab adopts this monitor and changes nothing else. On a laptop with two graphics cards, set &lt;strong&gt;Settings &amp;gt; Browser &amp;gt; Graphics processor&lt;/strong&gt; the same way as on your other computer. &lt;a href="https://passkeel.com/docs/profiles/other-computers" rel="noopener noreferrer"&gt;Profiles on other computers&lt;/a&gt; explains why.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Turn on Close when idle for sensitive profiles&lt;/strong&gt; you'll use at this desk, so a profile left open at an empty desk closes and, if it's locked, locks again. More in &lt;a href="https://passkeel.com/blog/lock-and-hide-profiles-on-shared-computers" rel="noopener noreferrer"&gt;lock, hide and sign out&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your first day with two computers
&lt;/h2&gt;

&lt;p&gt;Open a profile on the new computer while it's still open on the old one, and PassKeel says so and offers &lt;strong&gt;Ask to close it there&lt;/strong&gt;. Between computers of your own account, the other one saves, uploads and hands the profile over at once. After that, the routine is simply to close profiles when you leave one computer and open them at the other. The &lt;a href="https://passkeel.com/blog/office-and-home-profiles-everywhere" rel="noopener noreferrer"&gt;office and home guide&lt;/a&gt; walks through it, including what happens if a profile ends up with two versions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Leaving the old computer clean
&lt;/h2&gt;

&lt;p&gt;If the old computer is going back to IT, to a colleague or to the recycling:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Close your profiles&lt;/strong&gt; on it, so their last changes upload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Check everything is synced.&lt;/strong&gt; Profiles you kept &lt;strong&gt;Only on this computer&lt;/strong&gt; are not in the cloud. Turn on &lt;strong&gt;Sync this profile&lt;/strong&gt; in their &lt;strong&gt;Sync…&lt;/strong&gt; dialog if you want to keep them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Sign out and remove your profiles.&lt;/strong&gt; Choose &lt;strong&gt;Sign out&lt;/strong&gt; and tick &lt;strong&gt;Also remove this account's profiles from this computer&lt;/strong&gt;. PassKeel warns you if any profile was never synced, since that one would be lost, and finishes the uploads that are due before it signs out. Synced profiles come back on any computer where you sign in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Already gave it away?&lt;/strong&gt; From any other computer, &lt;strong&gt;Account &amp;gt; Computers&lt;/strong&gt; lists the computers signed in to your account. &lt;strong&gt;Sign out&lt;/strong&gt; next to the old one ends its sessions and releases the profiles it had open.&lt;/p&gt;

&lt;h2&gt;
  
  
  Housekeeping
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Account &amp;gt; Computers&lt;/strong&gt; is worth a glance now and then; sign out anything you don't recognise or no longer use, and change your password if in doubt.&lt;/li&gt;
&lt;li&gt;Computers don't count against your plan, so there's no need to retire one to add another.&lt;/li&gt;
&lt;li&gt;Check your sync sizes if the new computer is on a slow connection: &lt;a href="https://passkeel.com/blog/keeping-profile-sync-small" rel="noopener noreferrer"&gt;keeping profile sync small&lt;/a&gt; explains what's left out and how to choose more.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>guides</category>
      <category>sync</category>
      <category>multiplecomputers</category>
    </item>
    <item>
      <title>Lock, hide and sign out: keeping profiles private on shared computers</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 07:42:54 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/lock-hide-and-sign-out-keeping-profiles-private-on-shared-computers-4h0i</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/lock-hide-and-sign-out-keeping-profiles-private-on-shared-computers-4h0i</guid>
      <description>&lt;p&gt;Carrying your profiles between &lt;a href="https://passkeel.com/blog/office-and-home-profiles-everywhere" rel="noopener noreferrer"&gt;the office and home&lt;/a&gt; is convenient, but it means your profiles sit on more than one computer. At home that's usually fine. At the office, a colleague might sit down at your desk while you're in a meeting, the PC might be shared with the next shift, or IT might hand your machine to someone else next year.&lt;/p&gt;

&lt;p&gt;PassKeel has a few protections for exactly this, and they're different tools for different risks. This post explains each one, in plain terms, including what it doesn't protect against.&lt;/p&gt;

&lt;h2&gt;
  
  
  One PIN for your account
&lt;/h2&gt;

&lt;p&gt;Locking and hiding both use your &lt;strong&gt;account PIN&lt;/strong&gt;: one 6-digit PIN that, in the app's words, "opens every locked profile and shows hidden ones, on all your computers. You only need to set it once."&lt;/p&gt;

&lt;p&gt;PassKeel asks you to &lt;strong&gt;Create your PIN&lt;/strong&gt; the first time you lock or hide a profile; you can also set or change it under &lt;strong&gt;Settings &amp;gt; Security&lt;/strong&gt;. The same PIN works on your office PC and your home PC. It's checked on your computer and never sent to PassKeel's servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lock with PIN: for profiles where a stranger could do damage
&lt;/h2&gt;

&lt;p&gt;Open a profile's editor, go to the &lt;strong&gt;Security&lt;/strong&gt; tab and turn on &lt;strong&gt;Lock with PIN&lt;/strong&gt;. The app describes it: "Its cookies and saved logins are encrypted. Every time it opens, PassKeel asks for your PIN, on every computer."&lt;/p&gt;

&lt;p&gt;A few things worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PassKeel asks for the PIN &lt;strong&gt;every time&lt;/strong&gt; the profile opens, even right after you closed it. There's no "unlocked for a while" window.&lt;/li&gt;
&lt;li&gt;The lock syncs, so a profile you lock at home is locked at the office too.&lt;/li&gt;
&lt;li&gt;Locked profiles show a lock icon in the list. Removing the lock needs the PIN.&lt;/li&gt;
&lt;li&gt;Scripts that open a locked profile through the local API have to send the PIN with each open.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use it for the profiles that matter: payment and admin accounts, client accounts with money on them, anything you wouldn't want opened by whoever sits at your desk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wrong guesses are limited.&lt;/strong&gt; The first four wrong PINs in a row cost nothing; after the 5th to 9th you wait before the next try (30 seconds, then longer, up to 5 minutes). After 10, the PIN is turned off on that computer until it's reset with your account password. Forgot it yourself? &lt;strong&gt;Forgot PIN?&lt;/strong&gt; and your account password set a new one, and nothing is lost: your locked profiles open with the new PIN.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hide: keep a profile out of sight
&lt;/h2&gt;

&lt;p&gt;On the same &lt;strong&gt;Security&lt;/strong&gt; tab, turn on &lt;strong&gt;Hide&lt;/strong&gt;: "It leaves the list, search and the API until you show hidden profiles." Hidden profiles also drop out of groups, counts and automation, and the hidden state syncs to your other computers.&lt;/p&gt;

&lt;p&gt;To see them, choose &lt;strong&gt;⋯ &amp;gt; Show hidden profiles…&lt;/strong&gt; and enter your PIN. They go out of sight again by themselves when Windows locks, after 10 minutes without use, when you sign out and when you close PassKeel. You can also hide them at once with &lt;strong&gt;Hide hidden profiles now&lt;/strong&gt; under &lt;strong&gt;Settings &amp;gt; Security&lt;/strong&gt;, which is a good habit before you step away from a desk.&lt;/p&gt;

&lt;p&gt;The app is plain about the limit, and so are we: "Hiding isn't encryption: it only keeps the profile out of sight. Lock it with your PIN to protect its data." Hiding stops a colleague glancing at your list from seeing a profile's name. Locking stops them opening it. For profiles that must stay private, use both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Close when idle: don't leave a profile open at an empty desk
&lt;/h2&gt;

&lt;p&gt;A lock only helps when a profile is closed. If you leave a locked profile open and walk away, it's open. &lt;strong&gt;Close when idle&lt;/strong&gt;, also on the &lt;strong&gt;Security&lt;/strong&gt; tab, closes a profile nobody is using: after 5, 15 (the default), 30 or 60 minutes, or a custom time. PassKeel counts mouse and keyboard use in that profile's window, and profiles running automation stay open. A minute before, a notice offers &lt;strong&gt;Keep open&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Combined with &lt;strong&gt;Lock with PIN&lt;/strong&gt;, that means a profile you forgot at the office locks itself again after a while.&lt;/p&gt;

&lt;h2&gt;
  
  
  Signing out of a shared or office PC
&lt;/h2&gt;

&lt;p&gt;Choose &lt;strong&gt;Sign out&lt;/strong&gt; at the bottom of the menu. Your profiles stay on the computer but, as the app says, "are hidden until you sign in again. Anyone who signs in here with another account can't see them." Each profile belongs to one account, so another person signing in to PassKeel on the same PC sees only their own profiles.&lt;/p&gt;

&lt;p&gt;On a computer you share or are about to give back, tick &lt;strong&gt;Also remove this account's profiles from this computer&lt;/strong&gt;: "For a shared computer. Synced profiles stay in your account and come back when you sign in on any computer." PassKeel tells you first if any profile was never synced, because those would be lost, and confirms with &lt;strong&gt;Remove and sign out&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before the session ends, signing out closes your open profiles (&lt;strong&gt;Close and sign out&lt;/strong&gt;) and finishes the uploads that are due, so you don't leave your latest changes behind on the office PC.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lost a laptop, or left the office PC signed in?&lt;/strong&gt; From any other computer, open &lt;strong&gt;Account &amp;gt; Computers&lt;/strong&gt; and choose &lt;strong&gt;Sign out&lt;/strong&gt; next to it. That "ends its sessions and releases the profiles it has open". Turning on two-step sign-in (&lt;strong&gt;Account&lt;/strong&gt;, under &lt;strong&gt;Security&lt;/strong&gt;) means someone who learns your password still can't sign in on a new computer without your phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Delete forever means gone from your account
&lt;/h2&gt;

&lt;p&gt;Sometimes the right answer is to get rid of a profile altogether. Moving it to the &lt;strong&gt;Trash&lt;/strong&gt; keeps it restorable for 30 days. &lt;strong&gt;Delete forever&lt;/strong&gt; (or &lt;strong&gt;Empty trash&lt;/strong&gt;) erases it, and since version 2.1.3 that includes the cloud: the confirmation says its "cookies, logins and browsing data are erased from this computer and from your account's cloud, so it doesn't come back on your other computers."&lt;/p&gt;

&lt;p&gt;What happens on your other computers: within about a minute, they notice the profile is gone from your cloud. A copy that was only listed there disappears; a copy whose files were downloaded moves to that computer's trash, with sync off. So if you delete a sensitive profile at home, it's worth emptying the trash on the office PC too. There's more in &lt;a href="https://passkeel.com/blog/deleting-a-profile-everywhere" rel="noopener noreferrer"&gt;deleting a profile for good&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What these protections can't do
&lt;/h2&gt;

&lt;p&gt;To be straightforward about the limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hiding isn't encryption. Locking is.&lt;/li&gt;
&lt;li&gt;A lock protects a closed profile. An open profile at an unlocked, unattended desk is open; lock Windows when you walk away (which also hides hidden profiles).&lt;/li&gt;
&lt;li&gt;Software running as your own Windows user can reach the same keys PassKeel uses. The PIN protects against a person at the keyboard and against copied files, not against malware on your account.&lt;/li&gt;
&lt;li&gt;If someone already copied data out of an open profile, no setting can recall it. Change the affected site passwords.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A sensible setup for office and home
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create your PIN once, under &lt;strong&gt;Settings &amp;gt; Security&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Lock the profiles that hold money, admin rights or client data.&lt;/li&gt;
&lt;li&gt;Hide the ones whose names alone you'd rather nobody saw, and lock those too.&lt;/li&gt;
&lt;li&gt;Turn on &lt;strong&gt;Close when idle&lt;/strong&gt; for locked profiles you use at the office.&lt;/li&gt;
&lt;li&gt;Lock Windows when you leave the desk, and use &lt;strong&gt;Hide hidden profiles now&lt;/strong&gt; if you showed them.&lt;/li&gt;
&lt;li&gt;On a shared PC, sign out with &lt;strong&gt;Also remove this account's profiles from this computer&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The docs go step by step: &lt;a href="https://passkeel.com/docs/profiles/protection" rel="noopener noreferrer"&gt;PIN-locked and hidden profiles&lt;/a&gt; and &lt;a href="https://passkeel.com/docs/account/security" rel="noopener noreferrer"&gt;account security&lt;/a&gt;. For the sync side of the same routine, see &lt;a href="https://passkeel.com/blog/office-and-home-profiles-everywhere" rel="noopener noreferrer"&gt;office and home: the same profiles on every computer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>guides</category>
      <category>multiplecomputers</category>
    </item>
    <item>
      <title>Keeping profile sync small: offline data, size limits and "Don''t sync"</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 07:42:23 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/keeping-profile-sync-small-offline-data-size-limits-and-dont-sync-456e</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/keeping-profile-sync-small-offline-data-size-limits-and-dont-sync-456e</guid>
      <description>&lt;p&gt;If you carry your profiles between &lt;a href="https://passkeel.com/blog/office-and-home-profiles-everywhere" rel="noopener noreferrer"&gt;an office and a home computer&lt;/a&gt;, sync size matters. Small profiles upload in seconds when you close them and download quickly at the other end. A profile that has quietly grown to hundreds of megabytes takes longer, uses more of your plan's storage and, past a point, doesn't upload at all.&lt;/p&gt;

&lt;p&gt;This post explains where the size comes from, what PassKeel leaves out on its own, and the per-site choice you get when a profile goes over your plan's limit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the megabytes come from
&lt;/h2&gt;

&lt;p&gt;Cookies and logins are tiny. What makes a profile big is usually &lt;strong&gt;offline data&lt;/strong&gt;: some web apps store large databases and caches in the browser so they work without a connection and load faster. A messaging or mail web app can keep hundreds of megabytes of it in one profile.&lt;/p&gt;

&lt;p&gt;That data is useful on the computer that has it, but it isn't what makes a profile &lt;em&gt;yours&lt;/em&gt;. If it's missing on another computer, the site downloads what it needs again. Your sign-in, by contrast, lives in cookies and local storage, which always sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  What PassKeel already leaves out
&lt;/h2&gt;

&lt;p&gt;By default, sync skips browser caches, crash reports and similar temporary files, plus the offline storage of a handful of large web apps: Gmail, Slack, Microsoft Teams, WhatsApp Web, Outlook, Google Drive and Docs, Figma and Discord. Their cookies and local storage still sync, so you stay signed in; only the big offline databases stay on each computer.&lt;/p&gt;

&lt;p&gt;Uploads are also incremental: after a profile's first upload, only the parts that changed are sent.&lt;/p&gt;

&lt;h2&gt;
  
  
  The per-profile limit
&lt;/h2&gt;

&lt;p&gt;Each synced profile has a size limit set by your plan: 200 MB on Free and Solo, 500 MB on Pro and higher (see &lt;a href="https://passkeel.com/docs/account/plans" rel="noopener noreferrer"&gt;plans and limits&lt;/a&gt; for the current table, including total storage). If a profile is a little over, optional browser data is left out first. If it's still over, nothing is uploaded, and the profile's status becomes &lt;strong&gt;Sync problem&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing what not to sync
&lt;/h2&gt;

&lt;p&gt;Since version 2.1.3, when a profile is over the limit PassKeel tells you why in words. The profile's &lt;strong&gt;Sync…&lt;/strong&gt; dialog says how big the profile is, what your plan allows, and "Nothing was uploaded", then lists every site with offline data in the profile, largest first, and how much you need to leave out. When it's relevant, it also names the plan that would fit the profile. If the dialog is closed, a notice offers &lt;strong&gt;Choose…&lt;/strong&gt; to open it.&lt;/p&gt;

&lt;p&gt;Next to each site is a &lt;strong&gt;Don't sync&lt;/strong&gt; button. The app explains the trade: "A site's offline data you don't sync stays only on this computer; on other computers the site may need to download it again. Its cookies and logins still sync." Choose it for the biggest site you don't need offline everywhere, and PassKeel syncs the profile again straight away. Repeat until it fits.&lt;/p&gt;

&lt;p&gt;The choice belongs to that profile and travels with it, so all your computers leave out the same site. It's reversible: the dialog's &lt;strong&gt;Offline data not synced&lt;/strong&gt; list shows every site left out, including the default ones (marked &lt;strong&gt;Not synced by default&lt;/strong&gt;), each with &lt;strong&gt;Sync again&lt;/strong&gt;. If syncing a site again would put the profile back over your limit, PassKeel warns you first.&lt;/p&gt;

&lt;p&gt;Some folders can't be tied to a site. Those appear by folder name, without a button; clearing that site's data in the browser is the way to make room.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other ways to keep things small
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clear a site's data&lt;/strong&gt; in the browser when you no longer need its offline copy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep a heavy profile on one computer&lt;/strong&gt; if you only ever use it there: turn off &lt;strong&gt;Sync this profile&lt;/strong&gt; in its &lt;strong&gt;Sync…&lt;/strong&gt; dialog (status &lt;strong&gt;Only on this computer&lt;/strong&gt;). It still counts towards your plan's profile limit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delete cloud copies you don't need&lt;/strong&gt; if your workspace's storage fills up: &lt;strong&gt;Sync… &amp;gt; ⋯ &amp;gt; Delete from the cloud…&lt;/strong&gt; removes a profile's cloud copy and its versions but keeps it on this computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Move up a plan&lt;/strong&gt; if your profiles genuinely need more than 200 MB each.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Read more
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://passkeel.com/docs/sync/how-it-works" rel="noopener noreferrer"&gt;How cloud sync works&lt;/a&gt; covers what is synced, plan limits and status labels. For the encryption side, see &lt;a href="https://passkeel.com/blog/encrypted-sync-and-hand-over" rel="noopener noreferrer"&gt;how encrypted sync and hand-over work&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>sync</category>
      <category>guides</category>
    </item>
    <item>
      <title>Trash, Delete forever and Delete from the cloud: removing a profile everywhere</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 07:42:15 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/trash-delete-forever-and-delete-from-the-cloud-removing-a-profile-everywhere-2l5e</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/trash-delete-forever-and-delete-from-the-cloud-removing-a-profile-everywhere-2l5e</guid>
      <description>&lt;p&gt;When your profiles live on an &lt;a href="https://passkeel.com/blog/office-and-home-profiles-everywhere" rel="noopener noreferrer"&gt;office PC and a home PC&lt;/a&gt;, deleting one raises a fair question: deleted &lt;em&gt;where&lt;/em&gt;? From this computer, from the other one, from the cloud? PassKeel has four different actions, each for a different job. This post lines them up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Move to trash: change your mind later
&lt;/h2&gt;

&lt;p&gt;Select a profile and choose &lt;strong&gt;Move to trash&lt;/strong&gt; (or press Delete). It leaves your list and waits in &lt;strong&gt;Trash&lt;/strong&gt; for 30 days, with everything in it, so &lt;strong&gt;Restore&lt;/strong&gt; brings it back as it was. The notice afterwards has &lt;strong&gt;Undo&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The trash belongs to the computer it's on. Moving a profile to the trash on one computer doesn't delete it from the cloud or from your other computers. Profiles in the trash still count towards your plan's profile limit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Delete forever: gone from your account
&lt;/h2&gt;

&lt;p&gt;In the trash, &lt;strong&gt;Delete forever&lt;/strong&gt; erases a profile now, and &lt;strong&gt;Empty trash&lt;/strong&gt; does the same for everything there. Profiles left in the trash for 30 days are deleted the same way.&lt;/p&gt;

&lt;p&gt;Since version 2.1.3, this reaches the cloud. The confirmation says it plainly: the profile's "cookies, logins and browsing data are erased from this computer and from your account's cloud, so it doesn't come back on your other computers. This can't be undone." The cloud copy goes with all its versions.&lt;/p&gt;

&lt;p&gt;What your other computers do, within about a minute of noticing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a profile that was only listed there (its files never downloaded) disappears;&lt;/li&gt;
&lt;li&gt;a profile whose files were downloaded there moves to that computer's trash, with sync off, so it never uploads again by itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That second point matters for privacy. If you delete a sensitive profile at home, the office PC's copy is in its trash, where it could still be restored. If you want it gone from that computer too, empty the trash there as well.&lt;/p&gt;

&lt;p&gt;If the profile is open on another computer at that moment, or you're offline, PassKeel remembers the deletion and finishes it at the next chance. A couple of cases work differently on purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Team profiles and profiles shared with you&lt;/strong&gt; aren't deleted for everyone by your Delete forever. They only leave your computer; the team keeps them. Deleting a team profile for the whole team is the explicit &lt;strong&gt;Delete from the cloud&lt;/strong&gt; below.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Someone you shared a profile with&lt;/strong&gt; keeps the local copy they already had, though it no longer syncs. That's the limit of &lt;a href="https://passkeel.com/blog/teams-roles-sharing-transfers" rel="noopener noreferrer"&gt;sharing&lt;/a&gt;: data that reached another computer can't be recalled.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Delete from the cloud: keep it here, remove it everywhere else
&lt;/h2&gt;

&lt;p&gt;Sometimes you want the opposite: keep a profile on this computer only, and remove it from the cloud and your other computers. Close it everywhere, open its &lt;strong&gt;Sync…&lt;/strong&gt; dialog, and choose &lt;strong&gt;⋯ &amp;gt; Delete from the cloud…&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This computer keeps its copy with sync turned off. The cloud copy and its versions are deleted, and your other computers drop theirs the next time they check the cloud: copies with files go to their trash, where they can be restored for 30 days. Turning sync on again later uploads the profile afresh.&lt;/p&gt;

&lt;h2&gt;
  
  
  Only on this computer: never upload it
&lt;/h2&gt;

&lt;p&gt;If a profile should simply never leave one computer, turn off &lt;strong&gt;Sync this profile&lt;/strong&gt; in its &lt;strong&gt;Sync…&lt;/strong&gt; dialog. Its status becomes &lt;strong&gt;Only on this computer&lt;/strong&gt; and nothing turns sync back on by itself. A copy already in the cloud stays there until you use &lt;strong&gt;Delete from the cloud…&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Signing out with "remove" isn't deleting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Also remove this account's profiles from this computer&lt;/strong&gt;, when you sign out of a shared PC, removes your profiles from that computer only. Synced ones stay in your account and come back wherever you sign in next. That's by design: it's for leaving a computer clean, not for deleting anything. More in &lt;a href="https://passkeel.com/blog/lock-and-hide-profiles-on-shared-computers" rel="noopener noreferrer"&gt;lock, hide and sign out&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which one do I want?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You want to…&lt;/th&gt;
&lt;th&gt;Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tidy up, with a way back&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Move to trash&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Erase a profile from your account for good&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Delete forever&lt;/strong&gt; (then empty the trash on your other computers)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keep it here, remove it from the cloud and other computers&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Sync… &amp;gt; Delete from the cloud…&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Never upload it in the first place&lt;/td&gt;
&lt;td&gt;Turn off &lt;strong&gt;Sync this profile&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Leave a shared computer clean&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Sign out&lt;/strong&gt; with &lt;strong&gt;Also remove this account's profiles from this computer&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The docs cover each one: &lt;a href="https://passkeel.com/docs/profiles/trash" rel="noopener noreferrer"&gt;trash and restore&lt;/a&gt; and &lt;a href="https://passkeel.com/docs/sync/versions#delete-a-profile-from-the-cloud" rel="noopener noreferrer"&gt;versions and deleting from the cloud&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>sync</category>
      <category>security</category>
      <category>guides</category>
    </item>
    <item>
      <title>Why we built our own browser</title>
      <dc:creator>Zero Heartbeat</dc:creator>
      <pubDate>Sun, 06 Dec 2026 07:32:24 +0000</pubDate>
      <link>https://dev.to/zero_heartbeat_06a3625d7a/why-we-built-our-own-browser-p1b</link>
      <guid>https://dev.to/zero_heartbeat_06a3625d7a/why-we-built-our-own-browser-p1b</guid>
      <description>&lt;p&gt;PassKeel could have been an app that launches Chrome with a different user-data folder and an extension that rewrites a few values. Plenty of tools started that way. We decided early that it wouldn't be, and that every PassKeel profile would run in a browser we build ourselves. That browser is &lt;strong&gt;Keel&lt;/strong&gt;, built from Chromium 160. This post explains why, what it took, and why we ended up shipping Keel as a browser of its own as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a profile manager needs from a browser
&lt;/h2&gt;

&lt;p&gt;A profile manager asks a browser for things browsers aren't designed to give:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A different device in every profile.&lt;/strong&gt; Each profile presents its own screen, graphics card, time zone, languages and more, and they have to hold everywhere: in the page, in iframes, in workers, in network headers, in what the GPU process reports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Before the first byte.&lt;/strong&gt; The values have to be in place before any page code runs. A script that rewrites values after a page starts is racing the page, and sometimes loses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets that stay secret.&lt;/strong&gt; Proxy passwords and the key that encrypts a profile's data shouldn't sit in a file or on a command line where any process can read them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation without a tell.&lt;/strong&gt; Puppeteer, Playwright and Selenium normally connect through a remote-debugging port, and launching a browser for automation changes how it behaves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No quiet failures.&lt;/strong&gt; If a proxy drops, the profile must not fall back to your real connection.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can approximate some of this from the outside, with extensions, injected scripts and DevTools overrides. Each approach leaves gaps, and gaps are exactly what fingerprinting looks for: a value that's right on the page and wrong in a worker is worse than no change at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing it inside the engine
&lt;/h2&gt;

&lt;p&gt;So the work moved inside. Keel Engine, the build PassKeel launches, has a managed mode made for profile managers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Settings are applied natively.&lt;/strong&gt; A profile's settings reach the browser, network, GPU and page processes before the first navigation, in every frame, pop-up and worker. There's no extension, injected script or DevTools override for a page to find.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets travel through a pipe.&lt;/strong&gt; Proxy passwords and the profile's storage key reach the engine over a private pipe, never in a file or on the command line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No debugging port.&lt;/strong&gt; In managed mode the engine refuses remote-debugging ports. Automation tools connect through PassKeel's token-protected bridge, which talks to the browser over that same private channel. Nothing about the launch changes when a tool attaches.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict proxy routing.&lt;/strong&gt; With a proxy set, nothing falls back to a direct connection, host names resolve through the proxy, and UDP traffic that can't be proxied is blocked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency checks.&lt;/strong&gt; Settings that contradict each other are refused with a clear error, instead of producing a half-real identity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Native input.&lt;/strong&gt; The window synchronizer uses the engine's own input capture and replay, which is faster and more reliable than scripted events.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keel Engine presents as plain Chromium, so a profile can claim Chrome or Edge consistently, and it keeps Chrome's normal feature set: a profile that claims to be Chrome has to behave like Chrome.&lt;/p&gt;

&lt;h2&gt;
  
  
  A device that travels
&lt;/h2&gt;

&lt;p&gt;Owning the engine also let us fix a problem that outside approaches can't. Profiles sync between computers, and computers have different graphics hardware. A profile created on a desktop with one graphics vendor would, on a laptop with another, either have to change identity or refuse to open. Since engine release r4, a profile keeps the GPU it claims on any computer. Drawing still uses the computer's real graphics chip, and fonts, emoji and form controls stay the computer's own, but the identity the profile presents is the one it was created with.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Maintaining a Chromium fork is real work. Chromium is enormous, it moves fast, and a fork that falls behind becomes a security problem. Our approach is to keep the changes small and well-contained, to carry them as patches we refresh onto new Chromium versions, and to test each build against the sites and checks our users depend on. A profile's browser version always matches the Keel it actually runs, because a browser that claims one version while supporting another's features is easy to catch.&lt;/p&gt;

&lt;p&gt;We also say plainly what doesn't work. Features that need Google's API keys, such as Google sign-in and sync, Translate, server speech recognition and network location, don't work in Keel. And for now, Keel runs on Windows 10 and 11 only; macOS and Linux are planned.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why ship it as a browser too
&lt;/h2&gt;

&lt;p&gt;Once we had a browser we trusted, using it every day was the natural test, and a few changes we'd made for profiles turned out to be what we wanted from a daily browser as well. So Keel also ships as &lt;strong&gt;Keel Browser&lt;/strong&gt;, a free browser you can install on its own.&lt;/p&gt;

&lt;p&gt;The differences are about what runs by default:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Memory Saver is on from the start.&lt;/strong&gt; Idle tabs are discarded and reload when you click them. Sleeping tabs are dimmed in the tab strip, feed sites wait longer before they sleep, and Keel restores where you'd scrolled to on most sites. In our own background-tab test, private memory fell from about 2.6 GB to about 590 MB over 12 minutes as tabs were discarded, with the discard time shortened for the test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Less running in the background.&lt;/strong&gt; Gemini resources, the on-device AI model service, VR and AR, the Remote Desktop host, Cast and Live Caption are removed from the build. Gemini in Chrome, Privacy Sandbox Topics and attribution reporting, Optimization Guide model downloads, shopping features and Lens are switched off. Google sign-in is off by default, with no usage statistics or crash reports unless you turn them on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Menus on the right monitor.&lt;/strong&gt; With monitors in extended mode and a forced display scale, Chromium could open menus, bubbles and pop-ups on the wrong screen. We found the cause in the display code and fixed it there, so menus, bubbles, pop-ups and window positions all land correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else is Chromium: extensions from the Chrome Web Store, DevTools, the PDF viewer, printing, spellcheck and Safe Browsing all work, and H.264, AAC and MP3 playback are included. Widevine for protected video downloads by itself a few minutes after the first start.&lt;/p&gt;

&lt;p&gt;Keel Browser installs per user, without administrator rights, doesn't make itself the default browser, and adds no services, scheduled tasks or updater. Windows may warn about a new installer; the download page lists the SHA-256 to check first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two builds, one codebase
&lt;/h2&gt;

&lt;p&gt;To sum up: Keel is one codebase with two builds. &lt;strong&gt;Keel Engine&lt;/strong&gt; runs every PassKeel profile, keeps Chrome's feature set and adds the managed mode. &lt;strong&gt;Keel Browser&lt;/strong&gt; is the everyday browser, quieter by default. Installing one doesn't affect the other, and PassKeel always brings its own engine.&lt;/p&gt;

&lt;p&gt;Read more on the &lt;a href="https://passkeel.com/products/keel-browser" rel="noopener noreferrer"&gt;Keel Browser page&lt;/a&gt;, in the &lt;a href="https://passkeel.com/docs/keel-browser" rel="noopener noreferrer"&gt;Keel docs&lt;/a&gt;, and in the &lt;a href="https://passkeel.com/release-notes#keel" rel="noopener noreferrer"&gt;release notes&lt;/a&gt;, where each engine and browser build is listed.&lt;/p&gt;

</description>
      <category>keel</category>
      <category>engineering</category>
    </item>
  </channel>
</rss>
