No project description provided
Project description
TFA CLI Tool
A command-line tool for managing two-factor authentication (2FA) TOTP codes.
Why did I build this?
- I wanted to understand how TOTP codes work. I don't like trusting access to my accounts to a black box which I don't understand.
- I don't keep my phone with me all the time.
- I'm worried about losing access to my accounts if I lose my phone.
I feel far more comfortable with TOTP codes now!
Should you use this?
Maybe? This probably isn't best practice for two factor authentication codes. The default assumption is that phones have better security than computers. Depending on how you manage passwords, and access to your e-mail someone with access to your computer probably has the ability to access your accounts.
The secret database is not encrypted. It a simple json file that gets rewritten on every modification. It might lose your secrets. You should keep backups, and probably use the qr code feature to add accounts an authenticator app.
I'm also not a security expert. I'm just a programmer who wanted to understand TOTP. Maybe you should use a standard tool instead.
Use at your own risk.
Installation
pip install tfa
There is no default location for the database because the point is to make secret management less opaque than typical authentication apps. Set a preferred location in your shell configuration.
export TFA_STORAGE_PATH=~/.config/tfa/accounts.json
The secrets are stored in a simple json file with no encryption.
Usage
Add a new account
tfa add <account_name> <secret_key>
# With custom issuer name
tfa add <account_name> <secret_key> --issuer "Custom Name"
# Force overwrite existing account
tfa add <account_name> <secret_key> -f
Get TOTP code
tfa code <account_name>
List accounts
tfa list
Remove account
tfa remove <account_name>
Generate QR Code
Generate a QR code to scan with other authenticator apps:
tfa qr <account_name>
Examples
# Add a new GitHub account
tfa add github JBSWY3DPEHPK3PXP --issuer "GitHub"
# Get current code
tfa code github
# Output: GitHub: 123456
# List all accounts
tfa list
# Output: github
# Generate QR code
tfa qr github
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tfa-0.2.0.tar.gz
.
File metadata
- Download URL: tfa-0.2.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/5.15.0-118-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f17b540e3a0343fb27dbb7a6c4e5f22dc7054e3d443d2c4440a8671b5c68621 |
|
MD5 | 427b6999bd02c6ace3a35fd3a41aabfd |
|
BLAKE2b-256 | 676a756c6209c3a6f4181e8eacc141781c06de8808203610d8fd07306112600a |
File details
Details for the file tfa-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: tfa-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/5.15.0-118-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc0fe9e75d0f8d46077530db94ad248bc9eedca9ef3dc31677ca016763ea0cb5 |
|
MD5 | 0fb16603ab3f1b6ff8a047df7cce007d |
|
BLAKE2b-256 | eb689efb969b38566aec5114ad3d746bdd94ab620c230512a8283d7f0f97c175 |