Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions contrib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tiny tool to export the set of secrets in .2fa into text file for [Authenticator Pro](https://stratumauth.com/)

usage:
```bash
./path-to/rsc2authpro.py .2fa > uris.txt
```

normally it prints into stdout set of secrets in form similar to

otpauth://totp/Example:alice@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example
16 changes: 16 additions & 0 deletions contrib/rsc2authpro.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env python3
import sys

def convert_rsc_config_to_otpauth(config_path):
with open(config_path, 'r') as f:
for line in f:
parts = line.strip().split()
if len(parts) == 3 and parts[1] == '6':
label, digits, secret = parts
otpauth = f"otpauth://totp/{label}:{label}?secret={secret}&issuer={label}&digits=6"
print(otpauth)

if len(sys.argv) < 2:
print("Usage: python rsc2authpro.py ~/.2fa")
sys.exit(1)
convert_rsc_config_to_otpauth(sys.argv[1])