← Notes

Migrating Away from Authy

Authy has no official export button, so getting your own TOTP secrets out means intercepting its own API traffic. Both Android and iOS work; iOS with mitmproxy is the less painful route.

Last updated

Line drawing of a smartphone showing a one-time-password code beside a key

Authy will happily hold your 2FA seeds hostage forever if you let it. There's no "export" anywhere in the app — every route out involves reading the encrypted token blob off the wire or off a rooted device, then decrypting it yourself with your backup password.

Android options

If you've already got a rooted phone (or don't mind rooting an emulator), this avoids mitmproxy entirely:

Whichever Android route you take, Aegis is the recommended app to land the codes in — open source, offline, and it supports a proper encrypted import/export of its own going forward.

The easier path: iOS + mitmproxy

Run mitmproxy on a Mac, log into Authy on an iPad through it, and read the encrypted token seed straight out of the proxied API request. Background reading:

Steps

  1. Start mitmproxy: mitmweb --allow-hosts "api.authy.com"
  2. On the iPad, log into Authy so its traffic passes through the proxy.
  3. In the mitmweb UI at http://127.0.0.1:8081/, find the request to https://api.authy.com/json/users/<user_id>/authenticator_tokens?otp3=<otp>&apps=&device_id=<device_id>&api_key=<api_key> and grab the response — it holds your encrypted token seeds.
  4. Set up a Python virtualenv: python3 -m venv authy && source authy/bin/activate
  5. Install the one dependency: pip3 install cryptography
  6. Run python3 decrypt.py (from the freedomtechhq post above) and enter your Authy backup password when prompted. It writes out decrypted_tokens.json.

Viewing the tokens as QR codes

Once you have decrypted_tokens.json, this turns each secret back into a scannable QR code so you can re-enroll it in whatever authenticator app you're moving to:

Install ruby
gem install rqrcode
Save that script (call it authy_qr.rb) next to decrypted_tokens.json
ruby authy_qr.rb

Scan each resulting QR code into the new app one at a time, then confirm the generated codes match before deleting anything from Authy.