This is a simple project to create an "agent" for Google Authenticator.
We export the raw TOTP key from Google Authenticator and then generate the code using a simple Python script.
[!CAUTION] Keep your key secret
Please ensure that your exported key is kept safe from unauthorized access.
If someone gains access to your key, they can generate TOTP codes just like your Google Authenticator does.
This could cause TOTP or two-factor authentication (2FA) to malfunction and lead to security issues for your account.
- Google Authenticator App and pre-registered codes
- UV, a modern manager for Python interpreters and packages, installed
- Dependency packages like
libzbar0andprotobuf-compiler, which are required during raw key transformation. You can install them viaapt.
git clone https://github.com/haward79/tfa_agent.git
cd tfa_agent
# Export your key and metadata from Google Authenticator
# Place the generated image in the project root and name it google_auth.jpg
protoc --python_out=. migration.proto
uv run python decode_parse.py
# In project root, a file named google_auth.bin should be generated
# This file contains your key and cleaned metadata
# You can safely delete the original image file and just use google_auth.bin
uv run python totp.py