Created
April 9, 2018 22:45
-
-
Save Rayquaza01/1d58fb8eb31714671bfeca85ea3936ec to your computer and use it in GitHub Desktop.
Python script to convert Google Authenticator database to a format the Authenticator extension can read
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sqlite3 | |
import json | |
conn = sqlite3.connect("databases") | |
c = conn.cursor() | |
c.execute("SELECT * FROM accounts") | |
obj = {"otp_list": []} | |
for row in c.fetchall(): | |
obj["otp_list"].append({ | |
"name": row[1], | |
"key": row[2] | |
}) | |
with open("totp.json", "w") as f: | |
f.write(json.dumps(obj)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment