$ show stratumauth/app
This repository contains Stratum, a free and open-source two-factor authentication (2FA) app for Android with Wear OS support. It implements TOTP, HOTP, Steam, Yandex, and mOTP code generation algorithms with configurable parameters. The app features encrypted local backups with AES-GCM/CBC and Argon2id/PBKDF2 key derivation, import from over 15 third-party authenticator apps (Aegis, Bitwarden, KeePass, etc.), QR code scanning via CameraX, and a Material Design 3 UI. The architecture follows a clean layered pattern with a core library (Stratum.Core) containing domain entities, OTP generators, backup converters, and service interfaces, a Droid project for the phone UI, and a Wear OS project. The codebase is well-organized with dependency injection (Autofac), repository pattern for SQLite persistence, and unit tests. It demonstrates strong data engineering skills in reverse-engineering and parsing various backup formats, implementing custom cryptography for Ente Auth, and maintaining a large icon database. The project is actively maintained, targets .NET 10, and has localization in 27+ languages.
The LLM identified 5 files worth highlighting for reuse:
Implements time-based one-time password (TOTP) generation per RFC 6238. Self-contained, no internal dependencies beyond base interfaces and standard .NET cryptography. Can be extracted as a standalone library for any .NET project requiring TOTP generation.
Implements counter-based one-time password (HOTP) generation per RFC 4226. Like Totp.cs, it is fully self-contained and implements the IGenerator interface. Suitable for reuse in any .NET application needing HOTP.
Abstract base class defining a template method for converting backup files from third-party authenticator apps. Provides a consistent interface (ConvertAsync returning ConversionResult with failures) and a password policy declaration. Concrete subclasses handle format-specific parsing and decryption. This pattern can be reused as a framework for building converters for any similar import/export tasks.
Converts KeePass KDBX4 databases (password-only) into the app's authenticator model. Handles variant dictionary, AES-KDF and Argon2id key derivation, HMAC-SHA256 block verification, and decryption with AES, ChaCha20, and Twofish. Demonstrates complex parsing and cryptographic handling that could be extracted as a KeePass parser library.
Implements the HChaCha20 key derivation function (used in XChaCha20). A low-level cryptographic primitive, self-contained and based on RFC 8439. Could be reused in any .NET project needing HChaCha20 hashing without external crypto library dependencies.