Skip to content

Instantly share code, notes, and snippets.

@d-rk
Created February 22, 2024 19:55
Show Gist options
  • Save d-rk/3a616a3a31d5a122776706d32068c51b to your computer and use it in GitHub Desktop.
Save d-rk/3a616a3a31d5a122776706d32068c51b to your computer and use it in GitHub Desktop.
Convert encrypted aegis backup to keepassxc compatible csv file
# download decrypt script
curl -L https://raw.githubusercontent.com/beemdevelopment/Aegis/master/docs/decrypt.py > decrypt.py
# copy encrypted backup
scp host:/path/to/backup/aegis-backup-20231122-082604.json aegis-backup.json
# decrypt backup
python3 decrypt.py --input aegis-backup.json --output aegis-backup-decrypted.json
# convert to keepassxc compatible csv file
cat aegis-backup-decrypted.json | jq -r '["Group", "Title", "TOTP"], (.entries[] | [ .group, (.issuer + " - " + .name), ("otpauth://totp/" + (.name | @uri) + ":none?secret=" + .info.secret + "&period=" + (.info.period|tostring) + "&digits=" + (.info.digits|tostring) + "&issuer=" + (.issuer | @uri) )]) | @csv' > aegis-backup.csv
# finally run keepassxc and import from csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment