Skip to content

Labyrinth-xx/krypt

Repository files navigation

Krypt

TL;DR: Krypt is a local-first, open-source password manager built with Tauri + React + Rust. Every entry is encrypted on your own machine with Argon2id + AES-256-GCM, and secrets are only ever revealed via clipboard copy — plaintext never touches the screen or the frontend JS layer. It also exposes a CLI and an MCP server so AI agents (e.g. Claude Code) can use a secret without ever seeing its value. Status: active development, core password-manager features are stable; the AI-agent vault (API keys, CLI, MCP) is functional but has not yet been independently security-audited.

一个本地加密的密码管理桌面应用。 屏幕上永远是 ••••••••,需要时一键复制到剪贴板使用——全程不在屏幕上显示明文

为什么做这个

用备忘录记密码 → 每次查看必须把明文展开 → 旁边有人时密码就暴露了。

Krypt 反过来:复制可用,显示需主动

  • 密码默认显示为 ••••••••,长度也不暴露真实位数
  • 点"复制"按钮,明文从 Rust 直接写入系统剪贴板(不经过 JS)
  • 想确认密码时点眼睛图标,再点一下隐回去
  • 所有数据用主密码 Argon2id + AES-256-GCM 本地加密
  • 主密码不存盘,忘了 = 数据丢失(无后门)

功能

  • ✅ 主密码 + 本地加密(Argon2id + AES-256-GCM)
  • ✅ 密码 CRUD(标题/账号/密码/URL/备注/分类/标签)
  • ✅ 实时搜索(标题/账号/URL/标签)
  • ✅ 自定义分类
  • ✅ 导出加密 JSON 备份
  • ✅ 从 Chrome / Bitwarden CSV 导入
  • ✅ 跟随系统暗色模式
  • ✅ 剪贴板 30s 自动清空
  • ✅ 空闲自动锁屏
  • ✅ Touch ID

开发

要求:Node 20+、Rust 1.75+、macOS 12+

# 安装依赖
npm install

# 开发模式(启动 Vite + Tauri 窗口)
npm run tauri dev

# 跑 Rust 单元测试
cd src-tauri && cargo test --lib

# 打包 .dmg
npm run tauri build

数据保存在:

  • macOS: ~/Library/Application Support/com.krypt.desktop/vault.db
  • Win: %APPDATA%\com.krypt.desktop\vault.db
  • Linux: ~/.local/share/com.krypt.desktop/vault.db

目录结构

krypt/
├── src-tauri/              Rust 后端
│   ├── src/
│   │   ├── crypto/          KDF + AES-GCM
│   │   ├── db/              SQLite + migrations
│   │   ├── commands/        IPC 命令
│   │   ├── state.rs         AppState(key + conn)
│   │   ├── models.rs
│   │   └── lib.rs
│   └── Cargo.toml
├── src/                    React 前端
│   ├── components/
│   │   ├── SetupScreen      首次设置
│   │   ├── UnlockScreen     解锁
│   │   ├── MainView         三栏主界面
│   │   ├── Sidebar          分类
│   │   ├── EntryList        列表+搜索
│   │   ├── EntryDetail      详情
│   │   ├── EntryForm        新建/编辑
│   │   ├── PasswordField    ★ 核心:•••• + 眼睛 + 复制
│   │   └── ImportExportDialog
│   ├── lib/api.ts           IPC 包装
│   ├── lib/types.ts
│   └── styles/globals.css   Apple 风格设计令牌
└── docs/
    ├── ARCHITECTURE.md
    └── modules/             垂直切片:每个功能的 Delete Path

安全模型

详见 docs/ARCHITECTURE.md

  • 主密码 → Argon2id (m=64MiB, t=3, p=4) → 32-byte key(驻留内存,关闭即失)
  • 每条密码独立的 96-bit nonce,AES-256-GCM 加密
  • 解锁验证:用 key 解密固定 magic bytes,AES-GCM tag 失败 = 密码错(不需要单独存 hash)
  • 剪贴板复制路径完全在 Rust 端完成,明文不经过前端 JS(避免 DevTools 抓取)
  • MasterKey 实现 zeroize-on-drop

安全免责声明 / Security Disclaimer

本项目尚未经过第三方安全审计,请自行评估风险后使用;欢迎安全研究者提 issue。 This project has not undergone a third-party security audit — use at your own risk, and security researchers are welcome to open an issue.

License

MIT

About

Local-first encrypted password manager built for the AI-agent era — agents can request & use your keys via MCP with human approval, but never see plaintext. Tauri + Rust, Argon2id + AES-256-GCM

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors