TOTP-based two-factor authentication in python
Generates 2FA codes
Add a new account from user input
Path to JSON file used to store account data (default: accounts.json)
Password used to encrypt secrets
Will prompt for password when not set
Print all accounts as otpauth URLs
Export accounts as QR code images into same folder as JSON file (requires qrcode)
Keep account names unmasked when adding
Display secret values in plain text when displaying codes
Import accounts from QR code data
Import account data from otpauth or otpauth migration URLs
Can handle multiple otpauth URLs delimited by ';'
Path to JSON file used to store account data (default: accounts.json)
Password used to encrypt secrets
Will prompt for password when not set
Keep account names unmasked when adding
Display 2FA codes:
p2fa.py --file ~/config/p2fa/accounts.jsonAdd a new account:
p2fa.py --add --file ~/config/p2fa/accounts.jsonImport account from an otpauth URL:
imp2fa.py --import "otpauth://totp/AWesker?secret=ABCDEF&issuer=UmbrellaCorp" --file ~/config/p2fa/accounts.json