Extract TOTP/HOTP secrets from Google Authenticator export QR code images (otpauth-migration://...) and write them to files.
This tool is meant for account migration / backup into other authenticators or password managers that accept:
- Base32 secrets
otpauth://URLs- CSV imports
⚠️ Security warning: The output contains your MFA secrets. Treat it like a password vault export:
- run on a trusted machine
- keep files encrypted
- do not commit output files to git
- wipe screenshots and exports after you’ve migrated
Given a folder of GA export QR screenshots/photos (typically multiple QR codes if you have many accounts), it:
- Reads QR codes from images using
zbarimg - Extracts the
data=payload fromotpauth-migration://offline?data=... - URL-decodes + Base64-decodes the payload
- Parses Google’s protobuf
MigrationPayload - Writes:
ga_secrets.csv(issuer, name, type, digits, algorithm, secret, otpauth url)otpauth_urls.txt(oneotpauth://per line)
It also deduplicates accounts across batches (in case you scan overlapping QR codes).
ga_export.py— main scriptrequirements.txt— Python dependencies
You need zbarimg available in your PATH.
Fedora / RHEL:
sudo dnf install zbarDebian / Ubuntu:
sudo apt-get install zbar-toolsArch:
sudo pacman -S zbarVerify:
zbarimg --versionInstall via pip:
pip install -r requirements.txtRecommended: use a virtualenv.
Put all your GA export QR images into a folder (e.g. ./exports/).
Run:
python3 ga_export.py ./exportsBy default it scans *.jpg and writes:
ga_secrets.csvotpauth_urls.txt
If your screenshots are PNG:
python3 ga_export.py ./exports --pattern "*.png"python3 ga_export.py ./exports -o my_secrets.csv --urls my_urls.txtOn the phone that has your codes:
- Open Google Authenticator
- Tap ⋮ → Transfer accounts
- Export accounts
- Capture every QR code shown (it may be “1 of N”, “2 of N”, …)
Export often spans multiple QR codes when you have many accounts.
Columns:
issuernametype(totporhotp)algorithm(usuallySHA1)digits(6 or 8)secret_base32counter(only relevant for HOTP)otpauth_url
One otpauth://... URL per line, suitable for generating QR codes or importing into tools that accept URLs.
- This tool parses Google Authenticator’s export format (
otpauth-migration://...). - If an image contains no readable QR, it’s skipped.
- Works best with crisp screenshots (not blurry photos).
MIT