gotp

command module
v0.0.0-...-f49ac7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2025 License: MIT Imports: 12 Imported by: 0

README

gotp - Google Authenticator 迁移工具

配合 2fa 命令行工具使用,从 Google Authenticator 导出数据中提取 OTP 密钥。

功能

解码 Google Authenticator 导出的迁移 URI,提取密钥后添加到 2fa 工具中使用。

安装

go install github.com/JeaNile/gotp@latest

或下载 预编译二进制

使用

1. 导出 Google Authenticator 数据
  1. 打开 Google Authenticator 应用
  2. 点击右上角 "..." → "转移账号" → "导出账号"
  3. 使用二维码扫描工具读取二维码内容(格式:otpauth-migration://offline?data=...
2. 解码提取密钥
gotp decode "otpauth-migration://offline?data=..."

输出示例:

======================================================================
找到 1 个账号:
======================================================================

账号 #1:
  名称:     [email protected]
  发行者:   Aliyun
  密钥:     LJRNKYKxxxxxxxxxxxx
  类型:     TOTP
  位数:     6
  当前动态口令: 123456

验证密钥是否正确:

gotp verify LJRNKYKxxxxxxxxxxxx 123456

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL