NAC-ABE Design » History » Version 4
Suravi Regmi, 11/24/2025 07:37 PM
| 1 | 1 | Suravi Regmi | # NAC-ABE Design |
|---|---|---|---|
| 2 | |||
| 3 | 3 | Suravi Regmi | |
| 4 | ### What NAC-ABE Provides |
||
| 5 | NAC-ABE implements name-based access control using two layers: |
||
| 6 | |||
| 7 | 1. **Symmetric encryption of data** using Content Key (CK). |
||
| 8 | 2. **ABE encryption of CK** using AA-issued public parameters and consumer policies. |
||
| 9 | |||
| 10 | Data is encrypted with a CK, and the CK itself is encrypted under ABE so that only authorized consumers holding a matching Decryption Key (DKEY) can recover it. |
||
| 11 | The Attribute Authority (AA) publishes public parameters and issues DKEYs, while NAC-ABE producers generate CKs and encrypted data using these parameters. |
||
| 12 | |||
| 13 | This removes the need for any online authorization server during data fetch and enables cryptographically enforced access control at the packet level. |
||
| 14 | |||
| 15 | --- |
||
| 16 | ### Why mGuard Uses KP-ABE |
||
| 17 | |||
| 18 | 4 | Suravi Regmi | A KP-ABE policy defines which identities can receive a Decryption Key (DKEY) and which data attributes that DKEY authorizes them to decrypt. Each policy includes: |
| 19 | 1 | Suravi Regmi | |
| 20 | 4 | Suravi Regmi | - A policy-id, which uniquely identifies the policy. |
| 21 | - A list of requester-names, representing the NDN identities that will receive the DKEY generated from this policy. |
||
| 22 | - One or more attribute-filters, typically expressed as namespace prefixes. These prefixes determine which encrypted Content Keys (CKs) the resulting DKEY can decrypt. |
||
| 23 | |||
| 24 | Policies are evaluated using exact prefix matching. If the attribute attached by the producer during CK generation starts with a prefix listed in an allow-filter, a DKEY created from that policy will successfully decrypt the CK. |
||
| 25 | No role-based or device-level semantics are required; access control is driven entirely by namespace prefixes embedded within attributes. |
||
| 26 | |||
| 27 | 1 | Suravi Regmi | KP-ABE supports stream-specific semantics and flexible downstream authorization. |
| 28 | |||
| 29 | 4 | Suravi Regmi | In KP-ABE, the producer assigns an attribute string to each Content Key (CK). The consumer receives a DKEY that contains a policy, usually expressed as one or more namespace prefixes. Decryption succeeds when: |
| 30 | |||
| 31 | - policy_prefix is a prefix of attribute_string |
||
| 32 | |||
| 33 | This creates a simple, deterministic Matching Rule: |
||
| 34 | |||
| 35 | - The producer attaches attributes to CKs. |
||
| 36 | |||
| 37 | - The consumer holds a DKEY containing a prefix-based policy. |
||
| 38 | |||
| 39 | - Authorization is validated locally through prefix comparison. |
||
| 40 | - T he producer never evaluates policies and never needs access to DKEYs. All authorization takes place on the consumer side using the policy embedded in the DKEY. |
||
| 41 | |||
| 42 | 1 | Suravi Regmi | --- |
| 43 | |||
| 44 | 4 | Suravi Regmi | ### Certificates |
| 45 | |||
| 46 | NAC-ABE uses two distinct certificates, each serving a different purpose in the trust and encryption pipeline. |
||
| 47 | |||
| 48 | #### Stream Certificate |
||
| 49 | |||
| 50 | The stream certificate defines the namespace and identity under which CKs and encrypted data are published. NAC-ABE derives CK names from this certificate: |
||
| 51 | |||
| 52 | ``` c |
||
| 53 | /<stream-identity>/CK/<random>/ENC-BY/<attributes>/seg=i |
||
| 54 | ``` |
||
| 55 | |||
| 56 | |||
| 57 | Encrypted data packets are also named under the same identity prefix. This ensures that each stream's data and CKs are isolated and validated using the stream's trust chain. |
||
| 58 | |||
| 59 | #### Attribute Authority (AA) Certificate |
||
| 60 | |||
| 61 | The AA certificate anchors the ABE trust domain. It is used to validate: |
||
| 62 | |||
| 63 | - Public Parameters (PUBPARAMS) |
||
| 64 | |||
| 65 | - AA KEY packets |
||
| 66 | |||
| 67 | - Any ABE-related metadata |
||
| 68 | |||
| 69 | - The AA certificate ensures that only authenticated parameters are used for CK generation and that consumers can trust the DKEYs they receive. |
||
| 70 | |||
| 71 | 3 | Suravi Regmi | ## 3. ABE Encryption of CK (Black Box Description) |
| 72 | |||
| 73 | When the producer encrypts one data chunk: |
||
| 74 | |||
| 75 | 1. Producer calls: |
||
| 76 | 2. Output: |
||
| 77 | - a fresh **symmetric CK** |
||
| 78 | - CK segments encrypted with KP-ABE (using AA public parameters) |
||
| 79 | 3. Producer encrypts the data payload with CK. |
||
| 80 | 4. Producer embeds the **CK name** inside the encrypted data. |
||
| 81 | 5. Producer publishes: |
||
| 82 | - CK segments |
||
| 83 | - encrypted data segments |
||
| 84 | |||
| 85 | The consumer later: |
||
| 86 | - fetches CK segments, |
||
| 87 | - decrypts CK using its DKEY, |
||
| 88 | - decrypts the encrypted data. |
||
| 89 | |||
| 90 | The producer treats ABE internals as a complete black box. |
||
| 91 | |||
| 92 | --- |
||
| 93 | 1 | Suravi Regmi | |
| 94 | 3 | Suravi Regmi | ## 4. Certificates in NAC-ABE (Updated mGuard Behavior) |
| 95 | |||
| 96 | ### 4.1 Stream Identity Certificate |
||
| 97 | The stream’s certificate is used by NAC-ABE for: |
||
| 98 | |||
| 99 | **a) Naming CKs** |
||
| 100 | Updated mGuard naming: |
||
| 101 | 4 | Suravi Regmi | /<stream-identity>/CK/<CK-ID>/ENC-BY/<attributes>/seg=i |
| 102 | 3 | Suravi Regmi | This scopes CKs to each stream. |
| 103 | Different streams produce CKs under different prefixes. |
||
| 104 | |||
| 105 | **b) Naming encrypted data** |
||
| 106 | /<stream-identity>/<data-suffix> |
||
| 107 | This maintains per-stream isolation. |
||
| 108 | |||
| 109 | **c) Signing and trust schema validation** |
||
| 110 | All CK and encrypted data packets are signed according to the stream’s identity chain. |
||
| 111 | |||
| 112 | --- |
||
| 113 | |||
| 114 | ### 4.2 AA Certificate |
||
| 115 | The AA certificate is used as the **trusted root of ABE**. |
||
| 116 | |||
| 117 | It enables the producer and consumer to: |
||
| 118 | |||
| 119 | 1. Validate AA **Public Parameters (PUBPARAMS)**. |
||
| 120 | 2. Validate AA **KEY** packets. |
||
| 121 | 3. Determine **ABE type** from PUBPARAMS (KP-ABE vs CP-ABE). |
||
| 122 | 4. Run `kpContentKeyGen()` (needs verified public params). |
||
| 123 | |||
| 124 | The AA certificate defines the mathematical ABE domain; the stream certificate defines the namespace and signing authority for CK and data packets. |
||
| 125 | |||
| 126 | --- |
||
| 127 | |||
| 128 | ## 5. End-to-End Flow (Producer → Repo → Consumer) |
||
| 129 | |||
| 130 | ### 5.1 Producer Path |
||
| 131 | |||
| 132 | 1. **Per-stream CacheProducer initialization** |
||
| 133 | - loads stream cert |
||
| 134 | - loads AA cert into trust config |
||
| 135 | - fetches AA public parameters |
||
| 136 | |||
| 137 | 2. **Prepare data for encryption** |
||
| 138 | - data name suffix |
||
| 139 | - attribute list |
||
| 140 | - plaintext bytes |
||
| 141 | |||
| 142 | 3. **CK caching check** |
||
| 143 | - key = attributes-as-string |
||
| 144 | - if CK exists in cache → reuse |
||
| 145 | - else → generate new CK using `kpContentKeyGen` |
||
| 146 | |||
| 147 | 4. **CK generation on cache miss** |
||
| 148 | - ABE-encrypt CK using AA public parameters |
||
| 149 | - name CK under stream identity |
||
| 150 | - segment CK and store in cache |
||
| 151 | |||
| 152 | 5. **Data encryption** |
||
| 153 | - encrypt data with CK |
||
| 154 | - embed CK name into ciphertext |
||
| 155 | - segment encrypted data |
||
| 156 | |||
| 157 | 6. **Publishing** |
||
| 158 | - publish encrypted data segments |
||
| 159 | - publish CK segments (for new CK) |
||
| 160 | |||
| 161 | --- |
||
| 162 | |||
| 163 | ### 5.2 Consumer Path |
||
| 164 | |||
| 165 | 1. Fetch encrypted data segments. |
||
| 166 | 2. Extract CK name from ciphertext. |
||
| 167 | 3. Fetch CK segments. |
||
| 168 | 4. Use DKEY to decrypt ABE-encrypted CK. |
||
| 169 | 5. Use CK to decrypt the data. |
||
| 170 | |||
| 171 | All authorization is performed cryptographically using consumer DKEYs and producer-provided attributes. |
||
| 172 | |||
| 173 | --- |
||
| 174 | |||
| 175 | ## 6. ABE Key Issuance (DKEY Generation) |
||
| 176 | |||
| 177 | 1. Consumer sends a request (identity TLV) to AA. |
||
| 178 | 2. AA verifies consumer identity using trust schema. |
||
| 179 | 3. AA constructs a **DKEY containing a policy** (e.g., `"role:doctor AND device:dd40c"`). |
||
| 180 | 4. AA segments and returns DKEY packets. |
||
| 181 | 5. Consumer installs DKEY and uses it to decrypt CKs. |
||
| 182 | |||
| 183 | The AA never needs to be contacted again; DKEY is long-lived until revoked or replaced. |
||
| 184 | |||
| 185 | --- |
||
| 186 | |||
| 187 | ## 7. CK Granularity (Temporal Encryption Granularity) |
||
| 188 | |||
| 189 | CK granularity determines how often CKs rotate or are changed. |
||
| 190 | |||
| 191 | ### Common settings: |
||
| 192 | - **Second-level CKs** |
||
| 193 | Maximum security; high CK overhead. |
||
| 194 | - **Minute-level CKs** |
||
| 195 | Balanced performance vs granularity. |
||
| 196 | - **Hour-level CKs** |
||
| 197 | Minimal overhead; coarse access control. |
||
| 198 | |||
| 199 | Granularity influences both performance and access separation. |
||
| 200 | |||
| 201 | --- |
||
| 202 | |||
| 203 | ## 8. Tradeoffs of CK Reuse |
||
| 204 | |||
| 205 | ### High CK Reuse (e.g., minute/hour) |
||
| 206 | **Pros:** |
||
| 207 | - fewer CK packets |
||
| 208 | - reduced overhead |
||
| 209 | - faster encoding and repo insertion |
||
| 210 | |||
| 211 | **Cons:** |
||
| 212 | - larger window where one CK decrypts many packets |
||
| 213 | - coarse-grained access control |
||
| 214 | |||
| 215 | --- |
||
| 216 | |||
| 217 | ### Low CK Reuse (e.g., per second) |
||
| 218 | **Pros:** |
||
| 219 | - tight access control window |
||
| 220 | - limits impact of any single CK compromise |
||
| 221 | - better fine-grain policy enforcement |
||
| 222 | |||
| 223 | **Cons:** |
||
| 224 | - more CK segments to generate and publish |
||
| 225 | - more consumer fetches |
||
| 226 | - higher repo overhead |
||
| 227 | |||
| 228 | --- |
||
| 229 | |||
| 230 | ## Summary |
||
| 231 | - NAC-ABE supplies per-packet cryptographic access control. |
||
| 232 | - mGuard uses **KP-ABE** for attribute-driven encryption. |
||
| 233 | - **Stream certificates** now define CK and data namespaces. |
||
| 234 | - **AA certificate** anchors ABE trust and supplies public parameters. |
||
| 235 | - CKs are cached per attribute set, generated on demand, and consumed by any valid DKEY holder. |
||
| 236 | - CK granularity and reuse directly impact performance and access control precision. |
||
| 237 | 1 | Suravi Regmi |  |
| 238 | |||
| 239 | Why KP-ABE |
||
| 240 | |||
| 241 | Data encryption → CK encryption → CK decryption |
||
| 242 | |||
| 243 | ABE encryption of CK (black box) |
||
| 244 | |||
| 245 | ABE key issuance (DKEY) |
||
| 246 | |||
| 247 | CK granularity (second/minute/hour) |
||
| 248 | |||
| 249 | Tradeoffs of CK reuse level |
||
| 250 | 2 | Suravi Regmi | |
| 251 |  |
||
| 252 |  |