diff --git a/otp_conv.py b/otp_conv.py new file mode 100644 index 0000000..3992284 --- /dev/null +++ b/otp_conv.py @@ -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']))