„otp_conv.py“ hinzufügen
This commit is contained in:
parent
371143c7e2
commit
cff1baf19e
|
@ -0,0 +1,19 @@
|
||||||
|
#! /usr/bin/python3
|
||||||
|
|
||||||
|
"""
|
||||||
|
Convert Bitwarden Vault JSON exports OTP tokens into otpauth-Links
|
||||||
|
"""
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
|
f = open("bitwarden_export.json", "r", encoding="utf-8")
|
||||||
|
data = json.load(f)
|
||||||
|
|
||||||
|
for item in data['items']:
|
||||||
|
if 'login' in item:
|
||||||
|
if 'totp' in item['login']:
|
||||||
|
if item['login']['totp']:
|
||||||
|
if item['login']['totp'].startswith('otpauth'):
|
||||||
|
print(item['login']['totp'])
|
||||||
|
else:
|
||||||
|
print('otpauth://totp/'+str(item['login']['username'])+'?secret='+str(item['login']['totp'].replace(' ',''))+'&issuer='+str(item['name']))
|
Loading…
Reference in New Issue