BFLD 隐私门控 —— 机制详解¶
1. privacy_class 字节:具体数据暴露表¶
privacy_class 字节是决定 BFLD 节点被允许输出内容的唯一权威分类器。它由隐私门控模块(privacy_gate.rs)根据计算得到的 identity_risk_score 和操作员配置,为每个出站 BfldFrame 设置。
0 类 —— raw¶
仅用于本地研究捕获和红队验证。不是可部署配置。
| 字段 | 发布 | 备注 |
|---|---|---|
| presence | 是 | 布尔值 |
| motion | 是 | 0..1 浮点数 |
| person_count | 是 | u8 |
| identity_risk_score | 是 | f32 |
| rf_signature_hash | 是 | 轮换 blake3,32 字节十六进制 |
| zone_activity | 是 | |
| confidence | 是 | |
| compressed_angle_matrix | 是 | 每个子载波的 Phi/Psi —— 敏感面 |
| amplitude_proxy | 是 | |
| phase_proxy | 是 | |
| snr_vector | 是 | |
| bfi_matrix (raw) | 绝不 | 序列化前丢弃;不在线格式中 |
| identity_embedding | 绝不 | 仅本地 RAM;不在线格式中 |
1 类 —— derived¶
操作员选择加入诊断时的默认值。包含 identity_risk_score 和哈希,但不包含角度矩阵。
| 字段 | 发布 | 备注 |
|---|---|---|
| presence | 是 | |
| motion | 是 | |
| person_count | 是 | |
| identity_risk_score | 是 | 诊断用;不在 HA 默认实体中 |
| rf_signature_hash | 是 | 仅轮换哈希 |
| zone_activity | 是 | |
| confidence | 是 | |
| compressed_angle_matrix | 否 | 已清零 |
| amplitude_proxy | 否 | |
| phase_proxy | 否 | |
| snr_vector | 是 | 仅每流聚合 |
| bfi_matrix (raw) | 绝不 | |
| identity_embedding | 绝不 |
2 类 —— anonymous¶
所有标准部署的默认值。不包含身份相关字段。
| 字段 | 发布 | 备注 |
|---|---|---|
| presence | 是 | |
| motion | 是 | |
| person_count | 是 | |
| identity_risk_score | 否 | 已抑制 |
| rf_signature_hash | 否 | 已抑制 |
| zone_activity | 是 | |
| confidence | 是 | |
| 所有角度/幅度/相位字段 | 否 | 已清零 |
| bfi_matrix (raw) | 绝不 | |
| identity_embedding | 绝不 |
3 类 —— restricted¶
最大隐私。适用于护理机构、医疗部署和宾客空间。
| 字段 | 发布 | 备注 |
|---|---|---|
| presence | 是 | |
| motion | 否 | 已抑制 |
| person_count | 否 | 已抑制 |
| 所有其他字段 | 否 | |
| bfi_matrix (raw) | 绝不 | |
| identity_embedding | 绝不 |
2. rf_signature_hash 轮换算法¶
构造¶
site_salt := blake3_keyed_hash(secret="bfld-site-seed", data=node_mac_address)
# Generated once at first boot, stored in NVS, never transmitted
# 32 bytes
day_epoch := floor(timestamp_ns / 86_400_000_000_000)
# One new epoch per UTC day
ephemeral := mean_angle_delta ‖ subcarrier_variance ‖ burst_motion_score
# A small fixed-length summary of the current window's features
# Not identity-specific — any of several persons could produce
# similar values
rf_signature_hash := BLAKE3(
key = site_salt, // 32 bytes; site-specific secret key
input = day_epoch_bytes(8) ‖ ephemeral_features(24)
)
为什么跨站点再识别在结构上不可能¶
位于站点 A 和站点 B 的两个 BFLD 节点会产生:
BLAKE3 是一个以 site_salt 为密钥的 PRF(伪随机函数族)。在相同的 day ‖ features 输入下,由于 salt_A != salt_B,hash_A 和 hash_B 是伪随机且相互独立的。观察 hash_A 和 hash_B 的攻击者,在不知道两个盐值的情况下,无法确定它们是否对应同一个人。
这不是安全证明;它是 BLAKE3 的 PRF 安全假设的结果,只要 site_salt 保持机密,该假设就成立。
为什么站点内、日内跟踪是安全的¶
在单个站点的同一天内,来自同一个人的两个帧会产生相似的临时特征,从而导致相似的(尽管不完全相同——临时特征存在帧间变化)哈希值。这是有意为之:它允许在一次会话内对同一人的事件进行聚类,而不会导致身份恢复。
该哈希不是身份。它是 (site, day) 范围内的一个假名。一个人在两天访问同一站点时,每天会得到不同的假名。
每日轮换计划¶
epoch_0 = 0 # day 0 (unix epoch: 1970-01-01)
epoch_k = k * 86_400_000_000_000 # day k in nanoseconds
rotation_time = epoch_{k+1} # midnight UTC
在轮换时间,所有现有的 rf_signature_hash 值都会与未来值在密码学上断开关联。轮换前的日志无法与轮换后的日志关联,即使是节点操作员也无法关联。
3. 身份嵌入生命周期¶
BFI frame arrives
|
v
Feature extraction (identity_risk.rs)
|
v
RuVector embedding computed: Vec<f32, 128>
|
+-------> identity_risk_score (scalar projection)
| Published (class 1) or suppressed (class 2/3)
|
v
In-RAM ring buffer (EmbeddingRingBuf)
- capacity: 600 frames (default 10 minutes at 1 Hz)
- implemented as VecDeque<Embedding> in heap memory
- NEVER written to disk (no serde, no file I/O in the type)
- NEVER serialized to any MQTT or HTTP path
- Cleared on node restart (RAM is volatile)
|
v [after retention window]
Dropped from ring buffer
环形缓冲区有两个用途:(1) temporal_stability 计算需要将当前嵌入与最近的嵌入进行比较;(2) 一致性门控(coherence_gate.rs,来自 v2/crates/wifi-densepose-signal/src/ruvsense/)使用最近的帧来判断新帧是现有轨迹的延续还是新事件。
Both purposes require only that the embeddings exist in RAM during the computation. Neither purpose requires persistence.
4. 隐私模式线格式差异¶
以下展示了当节点从类别 1(派生)过渡到类别 2(匿名)时,序列化 BfldFrame 负载中发生的变化;这正是操作员启用 privacy_mode 时发生的过渡。
BfldFrame {
magic: 0xBF1D_0001, // unchanged
version: 1, // unchanged
ap_id: blake3(node_mac ‖ "ap"), // unchanged (already hashed at ingress)
sta_id: ephemeral_u64, // unchanged (already ephemeral)
session_id: u64, // unchanged
quantization: 0x02, // unchanged (i8 in class 1)
privacy_class: 0x01 -> 0x02, // CHANGED
// Payload (compressed):
compressed_angle_matrix: [...], // class 1: present; class 2: zeroed + omitted
amplitude_proxy: [...], // class 1: present; class 2: omitted
phase_proxy: [...], // class 1: present; class 2: omitted
snr_vector: [...], // class 1: present; class 2: present (aggregate)
// Event (JSON within payload or outer envelope):
presence: true, // unchanged
motion: 0.42, // unchanged
person_count: 1, // unchanged
identity_risk_score: 0.71, // class 1: present; class 2: OMITTED
rf_signature_hash: "a3f2...", // class 1: present; class 2: OMITTED
zone_activity: "living_room", // unchanged
confidence: 0.88, // unchanged
payload_crc32: <recomputed> // recomputed after changes
}
线格式差异由验收测试套件验证:对于每个 privacy_class 值,相同输入必须产生确定性输出。
5. 未来字段的默认拒绝姿态¶
未来添加到 BfldFrame 或 BFLD 事件 JSON 中的每个新字段,在发布前都必须进行分类。流程如下:
- 新字段被添加到
BfldFrame结构体中。 #[privacy_class(minimum = N)]属性注解(或privacy_gate.rs中等价的运行时检查)声明该字段被抑制的最低隐私类别。- 单元测试断言:在类别 < N 时序列化包含该字段,在类别 ≥ N 时省略该字段。
- 添加该字段的 PR 如果没有分类注解,则无法通过 CI。
这由 crate 中自定义的 #[must_classify] lint 强制执行——BfldFrame 上任何没有分类属性的公共字段都会产生编译警告,并变成 CI 错误。
6. 可审计性:验证原始 BFI 从未离开网络¶
想要验证其 BFLD 节点未传输任何原始 BFI 或身份数据的操作员,可以使用以下流程:
6.1 网络层审计(tcpdump)¶
# On the node or a port-mirrored switch:
tcpdump -i eth0 -w bfld_audit.pcap port 1883 or port 8883
# After capture, search for the BFI frame magic bytes in the PCAP:
# Magic 0xBF1D_0001 in big-endian is bytes BF 1D 00 01
# If these bytes appear in the MQTT payload, raw BFI may be present.
# They should NOT appear — BFLD strips the angle matrix at privacy_class >= 2.
strings bfld_audit.pcap | grep -v "presence\|motion\|person_count" | wc -l
# Expected: only presence/motion/person_count keys in the MQTT payloads.
6.2 节点自检命令¶
# RuView CLI (planned for P3):
wifi-densepose bfld audit --duration 60s
# Output: "60 frames processed. 0 frames with raw_bfi in payload.
# 0 frames with identity_embedding in payload.
# privacy_class distribution: {2: 57, 3: 3}"
6.3 CI 确定性哈希检查¶
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 wi/RuView