Google Authenticator export format

Requirements

  • The Google Protocol Buffers tool, which can be found here, or in this repository.
  • TheOtpMigration.proto file present here — thank you to the author — or here.
  • A way to scan and create QR codes — zbarcam and qrencode for instance.

Export, edit, and import Google Authenticator’s data

zbarcam | \
sed 's/QR-Code://' | \
sed 's/otpauth-migration:\/\/offline?data=//' | \
sed -e 's/%2B/+/ig' -e 's/%2F/\//ig' -e 's/%3D/=/ig' | \
base64 -d | \
protoc --decode=MigrationPayload OtpMigration.proto \
> secrets
# Note the space before `echo`, it prevents the line
# to be saved in the command history, as it contains secret data
echo "<qr-code-data>" | \
cat secrets | \
protoc --encode=MigrationPayload OtpMigration.proto | \
base64 -w 0 | \
sed -e 's/+/%2B/ig' -e 's/\//%2F/ig' -e 's/=/%3D/ig' | \
sed 's/^/otpauth-migration:\/\/offline?data=/' | \
xargs echo | \
qrencode -t utf8 -o -

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Vulnerability Assessment

IoT Security: My testing experience and conclusions

PRINTNIGHTMARE VULNERABILITY

{UPDATE} Climb Challenge Mountain Drive Hack Free Resources Generator

Data Privacy Day 2019: Top Ten Privacy Tips

Top 25 Denial-of-Service (DoS) Bug Bounty Reports

Big Data Impacts the Web with Personalization of Content

{UPDATE} Spot the differences Guess 'em Hack Free Resources Generator

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Zwyx

Zwyx

More from Medium

Git: The Revolution In DevOps

SAP Commerce Cloud Developer P_C4H340_12 Questions and Answers

How I am making money as a freelancer on Upwork

Upwork interface screenhsot

CS373 Spring 2022: Isaac Adams