$ show Authenticator-Extension/Authenticator
This repository is a browser extension for generating two-factor authentication (2FA) TOTP and HOTP codes. It allows users to securely store account secrets (optionally encrypted with a passphrase), generate codes for login, and provides features such as autofill into web pages, cloud backups (Dropbox, Google Drive, OneDrive), and synchronization across browsers. The extension is built with TypeScript and Vue 2.x, using Webpack for bundling and Vuex for state management. It supports multiple browsers (Chrome, Firefox, Edge) and manifests for Manifest V3. The architecture consists of a background service worker (for handling events and cloud sync), a popup UI (for displaying codes and managing accounts), an options page (for settings), content scripts (for autofill and QR code scanning), and an import page. Data flows involve storing encrypted account secrets in browser storage, generating OTPs from these secrets, and securely backing up and restoring data via cloud services or encrypted files. External dependencies include browser APIs, cloud service APIs (OAuth), and cryptographic libraries (argon2-browser, crypto-js, node-gost-crypto). The codebase demonstrates good engineering practices with clear separation of concerns, reusable abstractions for encryption and storage, and a modular structure for UI components and cloud backup providers. It includes internationalization support, a security advisor for recommendations, and a test suite (unit and end-to-end). While the project faces some technical debt due to its reliance on Vue 2.x and complex backup integrations, it remains actively maintained and functional.
The LLM identified 3 files worth highlighting for reuse:
Defines a clean encryption interface and AES implementation using crypto-js. Used for encrypting account secrets and backups. Isolated, depends only on crypto-js, and can be extracted to any project needing symmetric encryption with a key derivation pattern.
Abstracts Chrome/Firefox storage APIs (sync, local, managed) into a promise-based class. Isolated, depends only on a small browser API wrapper, and can be reused in any browser extension needing storage abstraction with promise-based API and managed storage support.
Presentational text input component with label, placeholder, value binding, and error display. Uses Vue and vue-property-decorator. No internal dependencies, making it easily extractable to any Vue 2.x project for consistent form UI with error handling.