An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:memo: Add user usage guide to encrypted notebook docs https://github.com/siyuan-note/siyuan/issues/18034
Daniel5e2ac6324a9b
diff --git a/docs/ENCRYPTED-NOTEBOOK.md b/docs/ENCRYPTED-NOTEBOOK.mdindex 86c99d537e..5ce78de371 100644--- a/docs/ENCRYPTED-NOTEBOOK.md+++ b/docs/ENCRYPTED-NOTEBOOK.md@@ -298,7 +298,43 @@ An encrypted notebook is an island; some features are unimplemented because of t- **Noticeable latency**: Unlock ~1s, large-asset browsing (full decrypt per request with no cache), first access after lock (cold start).- **Zero impact on normal notebooks**: Encryption and routing logic short-circuits for non-encrypted boxes.-## 16. Usage Recommendations+## 16. Usage Guide++### First-time enablement+1. Go to **Settings → Access authorization → Encrypted notebooks** and toggle it on+2. Set a master password (double input + risk confirmation). The master password is the unified key for all encrypted notebooks — **you must remember it; there is no recovery backdoor**+3. Once enabled, you can **create a new encrypted notebook** from the file-panel "more" menu (enter a name + master password → auto-unlocks and opens)++> Strength recommendation: 12+ characters, mixed case + digits + symbols. Master-password strength directly determines brute-force resistance (the kernel derives keys with Argon2id, intentionally slow).++### Daily use: unlock and lock+- **Unlock**: Click a closed encrypted notebook → enter the master password → wait ~1 second (Argon2id derivation) → opens. Unlocking only affects that notebook; other encrypted notebooks stay locked+- **Lock**: Closing the notebook equals locking (DEK cleared + encrypted db deleted + plaintext caches cleared). **Locking after use** is the most important security habit — it minimizes the key's exposure time in memory+- **After restart**: All encrypted notebooks are force-closed; you must re-enter the master password to unlock (the DEK lives only in memory and is lost on restart)++> Important: An encrypted notebook is **only fully secure when locked**. While unlocked, authenticated APIs/plugins/MCP can read plaintext just like a normal notebook (see §12 Security premise).++### Changing the master password+Go to **Settings → Access authorization → Change master password**. Changing the password only re-wraps each box's WrappedDEK — **document data is not re-encrypted**, so it completes instantly. The key backup is auto-refreshed and synced after a password change.++### Multi-device sync+Encrypted-notebook ciphertext `.sy`/assets/AV definitions sync along with the data (ciphertext in, ciphertext out, self-consistent); the global key material (MasterSalt etc.) is also automatically backed up to the sync directory. **No manual "enable" is needed on a new device after sync**:++1. Configure the same sync account on the new device and complete a sync+2. Sync pulls the key backup to the local machine; the kernel auto-restores the "enabled" state+3. Just click the encrypted notebook and enter the master password to unlock and use it++If the notebook still shows as locked on the new device after sync, that is normal — click it and enter the master password.++### Import and export+- **Import**: Supports importing `.sy.zip` and Markdown; content is automatically DEK-encrypted before writing to disk, identical to manually created documents+- **Export**: Identical to normal notebooks (must unlock first; exports plaintext). `.sy.zip`, HTML, Word, PDF, Markdown, etc. are all supported; export is rejected while locked++### What if I forget the password+**It cannot be recovered** — by design (no backdoor). Even if the ciphertext has been synced to the cloud, it cannot be decrypted without the master password. **You must remember the master password; using a password manager is recommended.**++### Recovering from a lost key backup+If both `conf/conf.json` and the key backup in the sync directory are lost (an extreme case), re-enabling the encrypted-notebook feature will be rejected with a prompt to restore the backup file. As long as you can recover `notebook-crypto-backup.json` from the sync cloud or a local backup, put it back at `<workspace>/data/.siyuan/` and re-enable to unlock with the original master password.### Suitable scenarios for encrypted notebooks- Private diary, financial records, medical informationdiff --git a/docs/ENCRYPTED-NOTEBOOK.zh-CN.md b/docs/ENCRYPTED-NOTEBOOK.zh-CN.mdindex 9ae94b1661..5e251c5ac0 100644--- a/docs/ENCRYPTED-NOTEBOOK.zh-CN.md+++ b/docs/ENCRYPTED-NOTEBOOK.zh-CN.md@@ -298,7 +298,43 @@ AV 历史:- **感知明显的延迟**:解锁 ~1 秒、大 assets 浏览(每次解密无缓存)、锁定后首次访问(冷启动)。- **对普通笔记本零影响**:加解密与路由逻辑对非加密 box 短路跳过。-## 16. 使用建议+## 16. 使用指南++### 首次启用+1. 进入 **设置 → 访问授权 → 加密笔记本**,打开开关+2. 设置主密码(双输入确认 + 风险确认)。主密码是所有加密笔记本的统一钥匙,**必须牢记——没有找回后门**+3. 启用后即可在文件面板"更多"菜单里 **新建加密笔记本**(输入名字 + 主密码 → 自动解锁并打开)++> 强度建议:12 位以上,混合大小写 + 数字 + 符号。主密码强度直接决定抗暴力破解能力(内核用 Argon2id 派生密钥,故意慢)。++### 日常使用:解锁与锁定+- **解锁**:点击已关闭的加密笔记本 → 输主密码 → 等约 1 秒(Argon2id 派生)→ 打开。解锁仅作用于该笔记本,其他加密笔记本保持锁定+- **锁定**:关闭该笔记本即等于锁定(DEK 清除 + 加密 db 删除 + 明文缓存清空)。**用完即锁**是最重要的安全习惯,能最大程度减少密钥在内存的暴露时间+- **重启后**:所有加密笔记本强制关闭,需重新输主密码解锁(DEK 仅存内存,重启即丢失)++> 重要:加密笔记本**只有在锁定状态下才是全面安全的**。解锁期间,已认证的 API/插件/MCP 能像读普通笔记本一样读到明文(详见 §12 安全前提)。++### 修改主密码+进入 **设置 → 访问授权 → 修改主密码**。改密只需重新包络各 box 的 WrappedDEK,**不重新加密文档数据**,因此即时完成。改密后密钥备份会自动刷新并同步。++### 多设备同步+加密笔记本的密文 `.sy`/assets/AV 定义会随数据同步(密文进密文出,闭环自洽);全局密钥材料(MasterSalt 等)也会自动备份到同步目录。**新设备同步后无需手动"启用"**:++1. 在新设备配置好相同的同步账号并完成同步+2. 同步会把密钥备份拉到本地,内核自动恢复"已启用"状态+3. 直接点击加密笔记本,输入主密码即可解锁使用++若新设备同步后笔记本仍显示锁定属正常——点开输主密码即可。++### 导入与导出+- **导入**:支持导入 `.sy.zip` 和 Markdown,内容在落盘前自动用 DEK 加密,与手动创建的文档一致+- **导出**:与普通笔记本一致(需先解锁,导出明文)。`.sy.zip`、HTML、Word、PDF、Markdown 等格式均支持;锁定状态下拒绝导出++### 忘记密码怎么办+**无法恢复**——这是设计使然(没有后门)。即使密文已同步到云端,没有主密码也解不开。**务必牢记主密码,建议使用密码管理器保存**。++### 密钥备份丢失的恢复+若 `conf/conf.json` 与同步目录里的密钥备份同时丢失(极端情况),重新启用加密笔记本会被拒绝并提示恢复备份文件。只要能从同步盘或本地备份找回 `notebook-crypto-backup.json`,放回 `<工作区>/data/.siyuan/` 后重新启用即可用原主密码解锁。### 适合用加密笔记本的场景- 隐私日记、财务记录、医疗信息