Inspired by the original gist.
This snippet will extract all the OTP (2FA) keys from Authy, and convert them to scannable QR codes and URLs you can copy-paste into e.g. 1password. Unlike other approaches, this consumes the internal digits
record, making it compatible with authy-specific extra long 2FA codes.
- Install the Authy Chrome Extension and the Authy App.
- Open the authy app from the browser icon in the top right, and view some TOTP codes. This decrypts them so we can extract them.
- Visit the Chrome Inspector Page (chrome://inspect/#apps) and click 'inspect' under 'Authy'. If that's not there, you likely need to open the Authy app from chrome://apps/.
- In the window that pops up, click 'console' in the top menu, and paste in the below snippet:
appManager.getModel().map(({ name: username, decryptedSeed: secret, accountType: issuer, digits, period }) => ({
totpurl: `otpauth://totp/${
encodeURIComponent(issuer)
}:${
encodeURIComponent(username)
}?${Object.entries({
secret, issuer, digits
}).map(([k,v]) => [k,v].map(encodeURIComponent).join("=")).join("&")}`,
username, issuer,
})).forEach(({ totpurl, username, issuer }) => {
console.log(`%c ${username} ${issuer} ${totpurl}`, "font-size: x-large");
console.log("%c abcdefg", `font-size: 20em; color:transparent; background: url(${
"https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl="+encodeURIComponent(totpurl)
})`)
});
NB: it's unwise to post screenshots of these codes representing your 2FA secrets :p
Thanks, this was extremely helpful. The QR code generation doesn't work anymore, but it still exports the URLs I can just paste into 1password.