TwoFactorAuth

macOS SwiftUI App (2FA / TOTP) — secure, offline two-factor codes that never leave your Mac

Project type
macOS SwiftUI App (2FA / TOTP)
Platform
macOS
Category
SecurityApplication
Tech stack
Swift, SwiftUI, TOTP, Keychain, QR Code, Security
Status
Open source · Maintained
Links
GitHub repository · Project page

TwoFactorAuth is a native macOS two-factor authentication client built entirely in SwiftUI, designed around a simple principle: your second factors should never leave your machine. The app generates time-based one-time passwords locally and stores every secret inside the macOS Keychain, so credentials are protected by the same hardware-backed security enclave that guards the rest of the operating system. There is no account to create, no cloud sync, and no analytics phone-home — the moment you launch it, the app is fully functional and fully offline.

Under the hood the generator implements RFC 6238 TOTP (and HOTP for counter-based accounts) and supports SHA1, SHA256 and SHA512 digests, so it works with the full range of issuers including those that require stronger hash algorithms. Adding accounts is designed to be painless: scan a QR code with the built-in camera capture, paste an otpauth:// URI, or import a database directly from Google Authenticator to migrate dozens of entries in one move. Codes refresh on a rolling 30-second window with a clear progress indicator and, for accounts that need it, support for custom time steps and digit lengths.

Choosing SwiftUI kept the entire codebase in Swift and let the UI stay native rather than wrapped in a web view — menus, keyboard navigation, dark mode and accessibility all come from the platform for free. The interface stays deliberately minimal: a searchable list of accounts grouped by issuer, large monospaced codes for quick reading, and a dark palette that is easy on the eyes during late-night sessions. For anyone who wants authentication that respects privacy and never depends on a server, TwoFactorAuth is the macOS answer.

Key features

Technology stack

SwiftSwiftUImacOSTOTPKeychainQR CodeSecurity

About the developer

TwoFactorAuth is built by Harsh Kadyan, a 22-year-old full stack developer and AI engineer from Rohtak, Haryana who codes under the alias BrutalHarsh. His work ranges from native macOS and mobile apps to large backend systems and AI automation, always with an eye for security and clean engineering. Read more on the about page.

TwoFactorAuth — Secure macOS SwiftUI 2FA / TOTP App | Harsh Kadyan