Escaping Google Authenticator: Generating TOTP Codes on the Command Line
2025-09-01

In an effort to reduce reliance on Google services, the author streamlined their Android phone to use only Google Maps and Authenticator for TOTP codes. To generate TOTP codes from the command line, they used oathtool, but the migration process proved complex. The article details migrating codes from Google Authenticator: exporting a QR code, decoding it with qrtool, extracting secrets using a Python script (otpauth_migrate), and finally generating TOTP codes with oathtool. A Bash script simplifies the process. Security concerns around storing secret keys are also addressed.
Development