Fast Auth——2FA APP开发进度汇报
开发进度
由于临近期末,需要推进即将截止的两个课设以及进行期末复习,开发进度暂时放缓。
目前开发进度已达到70%左右(整个项目进度),已实现核心功能
已开发功能
- [x] TOTP
- [ ] HTOP
- [ ] STEAM令牌
- [x] 使用Android密钥库加密存储Secret
- [ ] 导出
- [ ] 明文导出
- [ ] 端到端迁移
- [ ] NFC迁移
- [ ] QR迁移
界面
该演示图不代表最终效果(不过也大差不差了doge)
亮色模式下
[{"url":"https://pic.goodboyboy.top/imgs/2025/05/08/5g0v2.webp","alt":"首页","title":""},{"url":"https://pic.goodboyboy.top/imgs/2025/05/08/7h6t7.webp","alt":"设置页面","title":""}]
暗色模式下
[{"url":"https://pic.goodboyboy.top/imgs/2025/05/08/5pakd.webp","alt":"首页","title":""},{"url":"https://pic.goodboyboy.top/imgs/2025/05/08/5oz36.webp","alt":"设置页面","title":""}]
存储加密逻辑
MasterKey存储
sequenceDiagram
participant App as 客户端/应用
participant AndroidKeystore as Android密钥库系统
participant MasterKey as MasterKey
App->>AndroidKeystore: 1. 创建密钥库(KeyStore)
App->>MasterKey: 2. 生成MasterKey
App->>AndroidKeystore: 3.发起生物认证
AndroidKeystore->>MasterKey: 4. 使用AES-256加密MasterKey
MasterKey-->>App: 返回加密后的MasterKey
加密Secret
sequenceDiagram
participant App as 客户端/应用
participant AndroidKeystore as Android密钥库系统
participant MasterKey as MasterKey
participant OTPSecrete as OTPSecrete
App->>AndroidKeystore: 1. 发起生物认证
AndroidKeystore->>MasterKey: 2. 解密MasterKey
MasterKey->>OTPSecrete: 3.使用AES-256加密OTPSecrete
OTPSecrete-->>App: 返回加密后的OTPSecrete
解密Secret
sequenceDiagram
participant App as 客户端/应用
participant AndroidKeystore as Android密钥库系统
participant MasterKey as MasterKey
participant OTPSecrete as OTPSecrete
App->>AndroidKeystore: 1. 发起生物认证
AndroidKeystore->>MasterKey: 2. 解密MasterKey
MasterKey->>OTPSecrete: 3.使用解密OTPSecrete
OTPSecrete-->>App: 返回解密后的OTPSecrete
后记
本来是打算走QR迁移的,突然灵光一闪想着NFC不也是可以传输数据,并且安全性比QR高很多。
查了一下,不同的NFC tag的容量不一样,但是如果使用Android NFC的点对点功能,NDEF Push Protocol对NDEF消息长度并没有严格的上限,Payload Length允许为4字节长度。
所以理论上可以传输字节的数据,约4GB(雾),不过貌似实际超过几十KB到上百KB的消息就容易出现传输失败。
到时候可以做个选项,要是数据少的可以直接通过NFC传完,要是数据多的话就通过NFC交换AES加密密钥
如果有闲心的话弄个ECC也不是不行,用QR或者NFC传递公钥,不过目前Android密钥库貌似只支持ECDSA,并且没有像OpenPGP那样支持使用基于Curve25519的加密功能(我宁可用国密也不想用ECDSA),到时候找找有没有什么靠谱的实现
另外暂时没有找到好的图标来源,到时候再看吧
自己做软件的好处之一就是想加什么功能自己加就完事了(doge
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 GoodBoyboy 's Blog|惬意小屋-点滴记忆!
Invitation
GoodBoyboy
5201314***
created:09/04/2015
Welcome to MyBlog
Use this card to join MyBlog and participate in a pleasant discussion together .
Welcome to GoodBoyboy 's Blog,wish you a nice day .
评论
ArtalkUtterances