3 个版本
| 0.1.2 | 2022 年 8 月 29 日 | 
|---|---|
| 0.1.1 | 2022 年 8 月 29 日 | 
| 0.1.0 | 2022 年 8 月 29 日 | 
#16 在 #stateless
6KB
96 行
totper - 非常简单的 totp 命令行工具
一个非常简单的 totp 命令行实现,实际工作由 totp-lite 完成
用法
Usage: totper SECRET <STEP> <DIGITS> <ALG> <TIMESTAMP>
       or pipe the input parameters
  SECRET    = Unpadded Base32 (RFC4648) encoded secret
  STEP      = Seconds of step, defaults to 30
  DIGITS    = Number of digits in the result, defaults to 6
  ALG       = Algorithm SHA1, SHA256 or SHA512, defaults to SHA1
  TIMESTAMP = UTC Unix timestamp in seconds, defaults to current
  Note: practically all services use SHA1 as default
Examples:
  echo KZXW6ZDPN4 | totper
  766369
  totper KZXW6ZDPN4
  766369
安装
cargo install totper
如何存储密钥
我使用基于 GPG 的 pass 密码管理器,它将密钥存储在 GPG 加密的文件中。
待办事项
- 从 stdin 读取
- 也许应该改变参数的顺序,因为实际上应该始终从 STDIN 读取密钥?
依赖关系
~490–790KB
~13K SLoC