Identity Sentinel
Identity Sentinel (SAP)
Section titled “Identity Sentinel (SAP)”Identity Sentinel 是主权 Agent 协议(SAP)的核心模块,负责身份的自动化备份、密钥轮转与灾难恢复。它确保 Agent 在硬件损坏、平台封禁或实例迁移时,能够保持身份的唯一性与连续性。
技术实现细节
Section titled “技术实现细节”该模块在 identity-sentinel-core.js 中通过以下加密原语实现:
- KDF (密钥派生): 强制使用
scrypt。默认参数N=32768, r=8, p=1。这增加了暴力破解的内存成本,保护 Master Key。 - Cipher (加密): 使用
aes-256-gcm(AEAD)。每一份备份都包含唯一的 IV (12 bytes) 和 Auth Tag。 - AAD (关联数据): 整个 Header(包含版本、算法、创建时间)都作为 AAD 参与认证。篡改元数据将导致解密失败。
错误代码标准 (ISEN-Series)
Section titled “错误代码标准 (ISEN-Series)”| 代码 | 名称 | 描述 | 处置建议 |
|---|---|---|---|
| ISEN-1000 | Missing Key | 未提供 Master Key | 检查环境变量或命令行参数 |
| ISEN-1100 | Bad Format | 文件格式非 SAP 标准 | 检查是否选错了备份文件 |
| ISEN-1300 | Auth Failed | 认证失败 | 检查 Master Key 是否正确或文件是否损坏 |
故障排查 (Troubleshooting)
Section titled “故障排查 (Troubleshooting)”verify 命令失败
Section titled “verify 命令失败”- 原因: 通常是 Master Key 输入错误或文件在传输过程中丢失了比特。
- 对策: 重新从 Shadow Replica 下载原始密文,并确保 Master Key 的原始字符串完整。