Project

General

Profile

NAC-ABE Design » History » Version 3

Suravi Regmi, 11/24/2025 06:50 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
17
### Why mGuard Uses KP-ABE
18
mGuard uses **Key-Policy ABE (KP-ABE)** because:
19
20
- The *producer* supplies an **attribute set** for each stream’s data (e.g., `["device:dd40c", "sensor:accelerometer"]`).
21
- The *consumer* holds a **policy** embedded in its DKEY (e.g., `requester:researcher AND device:dd40c`).
22
- Decryption succeeds only if the consumer's policy matches the producer's attribute list.
23
24
The producer attaches an attribute set to each encrypted item, and each DKEY encodes a policy.
25
This shifts policy management away from producers and simplifies code.  
26
KP-ABE supports stream-specific semantics and flexible downstream authorization.
27
28
---
29
30
## 3. ABE Encryption of CK (Black Box Description)
31
32
When the producer encrypts one data chunk:
33
34
1. Producer calls:
35
2. Output:
36
- a fresh **symmetric CK**  
37
- CK segments encrypted with KP-ABE (using AA public parameters)  
38
3. Producer encrypts the data payload with CK.  
39
4. Producer embeds the **CK name** inside the encrypted data.  
40
5. Producer publishes:
41
- CK segments  
42
- encrypted data segments
43
44
The consumer later:
45
- fetches CK segments,
46
- decrypts CK using its DKEY,
47
- decrypts the encrypted data.
48
49
The producer treats ABE internals as a complete black box.
50
51
---
52
53
## 4. Certificates in NAC-ABE (Updated mGuard Behavior)
54
55
### 4.1 Stream Identity Certificate
56
The stream’s certificate is used by NAC-ABE for:
57
58
**a) Naming CKs**  
59
Updated mGuard naming:
60
/<stream-identity>/CK/<random>/ENC-BY/<attributes>/seg=i
61
This scopes CKs to each stream.  
62
Different streams produce CKs under different prefixes.
63
64
**b) Naming encrypted data**
65
/<stream-identity>/<data-suffix>
66
This maintains per-stream isolation.
67
68
**c) Signing and trust schema validation**
69
All CK and encrypted data packets are signed according to the stream’s identity chain.
70
71
---
72
73
### 4.2 AA Certificate
74
The AA certificate is used as the **trusted root of ABE**.
75
76
It enables the producer and consumer to:
77
78
1. Validate AA **Public Parameters (PUBPARAMS)**.
79
2. Validate AA **KEY** packets.
80
3. Determine **ABE type** from PUBPARAMS (KP-ABE vs CP-ABE).
81
4. Run `kpContentKeyGen()` (needs verified public params).
82
83
The AA certificate defines the mathematical ABE domain; the stream certificate defines the namespace and signing authority for CK and data packets.
84
85
---
86
87
## 5. End-to-End Flow (Producer → Repo → Consumer)
88
89
### 5.1 Producer Path
90
91
1. **Per-stream CacheProducer initialization**  
92
   - loads stream cert  
93
   - loads AA cert into trust config  
94
   - fetches AA public parameters
95
96
2. **Prepare data for encryption**  
97
   - data name suffix  
98
   - attribute list  
99
   - plaintext bytes
100
101
3. **CK caching check**  
102
   - key = attributes-as-string  
103
   - if CK exists in cache → reuse  
104
   - else → generate new CK using `kpContentKeyGen`
105
106
4. **CK generation on cache miss**
107
   - ABE-encrypt CK using AA public parameters  
108
   - name CK under stream identity  
109
   - segment CK and store in cache
110
111
5. **Data encryption**
112
   - encrypt data with CK  
113
   - embed CK name into ciphertext  
114
   - segment encrypted data
115
116
6. **Publishing**
117
   - publish encrypted data segments  
118
   - publish CK segments (for new CK)  
119
120
---
121
122
### 5.2 Consumer Path
123
124
1. Fetch encrypted data segments.  
125
2. Extract CK name from ciphertext.  
126
3. Fetch CK segments.  
127
4. Use DKEY to decrypt ABE-encrypted CK.  
128
5. Use CK to decrypt the data.
129
130
All authorization is performed cryptographically using consumer DKEYs and producer-provided attributes.
131
132
---
133
134
## 6. ABE Key Issuance (DKEY Generation)
135
136
1. Consumer sends a request (identity TLV) to AA.  
137
2. AA verifies consumer identity using trust schema.  
138
3. AA constructs a **DKEY containing a policy** (e.g., `"role:doctor AND device:dd40c"`).  
139
4. AA segments and returns DKEY packets.  
140
5. Consumer installs DKEY and uses it to decrypt CKs.
141
142
The AA never needs to be contacted again; DKEY is long-lived until revoked or replaced.
143
144
---
145
146
## 7. CK Granularity (Temporal Encryption Granularity)
147
148
CK granularity determines how often CKs rotate or are changed.
149
150
### Common settings:
151
- **Second-level CKs**  
152
  Maximum security; high CK overhead.
153
- **Minute-level CKs**  
154
  Balanced performance vs granularity.
155
- **Hour-level CKs**  
156
  Minimal overhead; coarse access control.
157
158
Granularity influences both performance and access separation.
159
160
---
161
162
## 8. Tradeoffs of CK Reuse
163
164
### High CK Reuse (e.g., minute/hour)
165
**Pros:**  
166
- fewer CK packets  
167
- reduced overhead  
168
- faster encoding and repo insertion
169
170
**Cons:**  
171
- larger window where one CK decrypts many packets  
172
- coarse-grained access control
173
174
---
175
176
### Low CK Reuse (e.g., per second)
177
**Pros:**  
178
- tight access control window  
179
- limits impact of any single CK compromise  
180
- better fine-grain policy enforcement  
181
182
**Cons:**  
183
- more CK segments to generate and publish  
184
- more consumer fetches  
185
- higher repo overhead
186
187
---
188
189
## Summary
190
- NAC-ABE supplies per-packet cryptographic access control.  
191
- mGuard uses **KP-ABE** for attribute-driven encryption.  
192
- **Stream certificates** now define CK and data namespaces.  
193
- **AA certificate** anchors ABE trust and supplies public parameters.  
194
- CKs are cached per attribute set, generated on demand, and consumed by any valid DKEY holder.  
195
- CK granularity and reuse directly impact performance and access control precision.
196 1 Suravi Regmi
![](old_nac-abe_in_mguard.png)
197
198
Why KP-ABE
199
200
Data encryption → CK encryption → CK decryption
201
202
ABE encryption of CK (black box)
203
204
ABE key issuance (DKEY)
205
206
CK granularity (second/minute/hour)
207
208
Tradeoffs of CK reuse level
209 2 Suravi Regmi
210
![](att-authority.png)
211
![](nac-abe-pro-con.png)