Fast Auth——2FA APP开发进度汇报
# 开发进度
由于临近期末,需要推进即将截止的两个课设以及进行期末复习,开发进度暂时放缓。
目前开发进度已达到 70% 左右(整个项目进度),已实现核心功能
# 已开发功能
# 界面
该演示图不代表最终效果(不过也大差不差了 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