Aegis OTP importing
Checks
- [x] I have read the Wiki, searched the open issues, and still think this is a new feature.
Explain the problem clearly and succinctly:
https://f-droid.org/packages/com.beemdevelopment.aegis I want to move my OTP tokens over here, but I sure as hell can't be bothered to do it manually for each token.
Describe the solution you'd like:
A built-in way to import, since Aegis is an android only app, it would make the most sense for the android version of keepass to be able to import it.
Describe alternatives you've considered:
Who in the wiki thought that uploading your passwords onto an online website was ever a good idea?
Additional context:
No response
Is there a specific data export format in Aegis? Nowadays, the most urgent export-import task would be to create an application that retrieves CSV and XML files to import a database in a KDBX file. This could be done at the same time, but you need to describe the export format for OTP data.
@J-Jamet yesn't. There's json (optionally unencrypted), plaintext (debatably close to csv) and html (dosen't seem to have an example file?) (so close to xml).
Great, thanks for the sources. I'll take a closer look when I make the global import system.
Hi, I wrote a simple python script to convert my Aegis database to import in KeepassXC, it's available then in KeepassDX. Be aware that it's for the German version, you need to change the values are assign the right one during the import.
Just export the Aegis database as unprotected/unencrypted JSON, save it as aegis_export.json and run "./aegis_to_keepassxc.py". The generated keepassxc_totp.csv can then be imported.
import json
import csv
# Input/output paths
INPUT_FILE = 'aegis_export.json'
OUTPUT_FILE = 'keepassxc_totp.csv'
# KeePassXC CSV format:
# Gruppe,Titel,Benutzername,Passwort,URL,Notizen,TOTP
def parse_aegis_entry(entry):
title = entry.get('issuer', '') + ' ' + entry.get('name', '')
title = title.strip()
username = entry.get('name', '')
secret = entry['info']['secret']
notes = entry.get('note', '')
return {
'Gruppe': 'TOTP',
'Titel': title,
'Benutzername': username,
'Passwort': '',
'URL': '',
'Notizen': notes,
'TOTP': secret
}
def main():
with open(INPUT_FILE, 'r', encoding='utf-8') as f:
data = json.load(f)
entries = [parse_aegis_entry(e) for e in data['db']['entries']]
with open(OUTPUT_FILE, 'w', newline='', encoding='utf-8') as f:
writer = csv.DictWriter(f, fieldnames=[
'Gruppe', 'Titel', 'Benutzername', 'Passwort', 'URL', 'Notizen', 'TOTP'
])
writer.writeheader()
writer.writerows(entries)
print(f"Exported {len(entries)} entries to {OUTPUT_FILE}")
if __name__ == '__main__':
main()
Who in the wiki thought that uploading your passwords onto an online website was ever a good idea?
Nobody and this is not what's happening. The conversion happens in your browser not on the server. You can download it, run it offline and it will be as safe or unsafe as anyone else's app/code from the internet.
Be aware that it's for the German version, you need to change the values are assign the right one during the import.
Wow. That's terrible. There are quite a few more languages than German and English.
Since Aegis at least offers an encrypted export, I would highly recommend to support importing those. An unencrypted export is an absolutely terrible idea and a completely unnecessary risk.
Be aware that it's for the German version, you need to change the values are assign the right one during the import.
Wow. That's terrible. There are quite a few more languages than German and English.
It's terrible that you didn't understand my intension why I posted this script. It was meant as an alternative/workaround until KeepassDX might have an import feature. But instead of asking how it was meant, it was just easier to offend me.
Be aware that it's for the German version, you need to change the values are assign the right one during the import.
Wow. That's terrible. There are quite a few more languages than German and English.
It's terrible that you didn't understand my intension why I posted this script. It was meant as an alternative/workaround until KeepassDX might have an import feature. But instead of asking how it was meant, it was just easier to offend me.
I was commenting on the fact that KeePassXC seems to expect language depended CSV headers for these imports and not on your solution. Unless you're a KeePassXC developer there is no reason to be offended by my statement.