How beemdevelopment/aegis works
Based on our analysis of the file tree and README, Aegis Authenticator is an Android application whose primary purpose is to serve as a secure, open source two‐factor authentication app. It focuses on security through encryption of a “vault” (using AES-256-GCM with scrypt derived keys and Android Keystore for biometrics) and also incorporates features for backup, importing/exporting credentials, and a rich user interface.
Main Components
• User Interface (UI) Layer:
• Represented by Activities, Fragments, Dialogs, and Views (e.g., AegisActivity.java, various components under ui/ and ui/dialogs, ui/fragments, and ui/components).
• This layer handles user interactions, screens (like authentication, entry list, settings, and import/export flows), and theme management.
• Business Logic and Controllers:
• Classes and modules (in the “aegis” package) that mediate between UI and lower-level functions.
• This includes tasks (in ui/tasks such as Argon2Task, Import/Export tasks), and classes that implement core functionalities like backup versioning, preferences handling, and entry ordering.
• Security & Cryptography Modules:
• Located under packages such as crypto, otp, and crypto sub-packages.
• Includes components for encryption (AES-256-GCM), key derivation (using scrypt), and OTP calculations (HOTP, TOTP).
• Also includes integration with Android Keystore for biometric/unlock support.
• Data Persistence Layer:
• The vault and database components (e.g., AppDatabase, Vault, VaultRepository) are critical for securely storing the 2FA entries.
• Includes backup and export/import functionalities as well as the vault’s JSON schema definitions.
• Import/Export and Integration Modules:
• Importer classes under “importers” adapt to multiple external formats (like Google Authenticator, Authy, and others) so that users can bring in their credentials.
• External Dependencies and Vendor Libraries:
• Testing & Quality Assurance:
• Separated test directories (androidTest and test) illustrate integration/unit tests that ensure reliability of cryptographic, database, and UI aspects.
Relationships and Interactions
• Interactions from importers/exporters with the secure data layer.
Architectural Patterns and Design Principles
• Although not based on explicit MVC/MVVM frameworks, the structure shows a clear separation between presentation (Activities, Fragments) and core logic (crypto, database, importers) — similar to the separation of concerns principle.
• The encryption vault and backup mechanisms reflect a strong emphasis on secure design and data integrity.
• The file structure also hints at modularity (i.e., each package handles distinct responsibilities) which is a useful guideline for your component breakdown.
Technologies, Frameworks, and Libraries
• Android framework components (Activities, Services, Receivers).
• Encryption libraries with AES-256-GCM and scrypt implementations.
• Android Keystore integration for biometric support.
• Gradle build system and testing frameworks.