2FA 一键解码工具
自动识别并解码各类 2FA 相关内容,一行命令出结果。
支持的解码类型(自动识别)
| 类型 | 说明 | 示例输入 |
|---|---|---|
| TOTP | RFC 6238 动态验证码 | secret: JBSWY3DPPHPDXV6T 或含 otpauth://totp/ 的 URI |
| HOTP | RFC 4224 计数器验证码 | 同上 + 计数器 |
| otpauth URI | 2FA 应用二维码内容 | otpauth://totp/Example:alice?secret=...&period=30 |
| Base32 | 密钥 Base32 解码 | JBSWY3DPPHPDXV6T → 原始字节 |
| URL 编码 | URLDecoder | %3Cscript%3E → <script> |
| HTML 实体 | HTML 实体解码 | <a> → <a> |
| URL 安全 Base64 | URL 安全 Base64 解码 | ABCD-_ 形式 |
| 明文密码 | 直接输出(供人工比对) | JBSWY3DPPHPDXV6T |
自动识别规则:
- 以
otpauth://开头 → 解析为 TOTP/HOTP,计算当前有效验证码 - 纯 Base32 且长度对齐 → 解码为 TOTP secret,输出当前 6/8 位验证码
- URL 编码特征(含
%XX)→ URLDecode - HTML 实体特征(含
&xxx;)→ HTML 解码 - URL 安全 Base64 特征 → Base64 解码
- 都不匹配 → 作为明文密码展示
快速开始
# 一键解码(自动识别类型)
python decode.py JBSWY3DPPHPDXV6T
# 指定 TOTP 算法与位数
python decode.py JBSWY3DPPHPDXV6T --sha256 --digits 8
# 从文件批量解码(每行一个)
python decode.py secrets.txt
# 交互式模式
python decode.py
文件说明
decode.py— 主程序(Python 3,无第三方依赖)secrets.txt— 示例密钥文件(每行一个待解码项)
安全提醒
- 解码结果中包含明文验证码与明文密码,请勿将输出提交到代码仓库或粘贴到公共渠道。
- 建议仅在本地、已加密的终端使用。
Release files for tfa-decode 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tfa_decode-0.1.0.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tfa_decode-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / tfa_decode-0.1.0.tar.gz
| Download URL | tfa_decode-0.1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66b971728a50539b3f8d0747cc7f32047dd2693ab8fabf60a0ab68d6f0c4431d
|
|
BLAKE2b-256 checksum How to use checksums |
5efe24bed34aee9d648d87e0de949ddc1cc085865e8215a7bc375233fe70d855
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / tfa_decode-0.1.0-py3-none-any.whl
| Download URL | tfa_decode-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b21d6fee1c56cec78379ebbe7e11c93c9aa96346ee340281b8a5791ae0a637b9
|
|
BLAKE2b-256 checksum How to use checksums |
5c220d90dd3f39d20be2cd3e4d520be698978cebb62dd096684532430044ced5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log