Because who needs Google Authenticator when you can roll your own sketchy system tray app?
Welcome to the most "enterprise-grade" 2FA authenticator you've ever seen! This beautiful piece of software engineering is a Windows system tray application that generates TOTP codes. It's like Google Authenticator, but with 100% more hardcoded values and 0% architectural patterns!
- โจ Single-file architecture - Exactly 1337 lines of pure, unadulterated chaos in one massive Program.cs!
- ๐จ "Modern" UI - Rounded corners! Subtle shadows! It's basically the next macOS!
- ๐ฑ Actually Responsive Design - Uses em units and screen percentages like a real web developer!
- ๐ Security First - All your secrets are safely embedded as resources (what could go wrong?)
- ๐ Blazing Fast - Updates every 500ms whether you need it or not!
- ๐พ Memory Efficient - Calls
GC.Collect()manually because long-running tray apps need love too! - ๐ฏ Production Ready - Contains helpful comments like
// Better vertical centering - โ๏ธ QR Code Scanning - Add new accounts on the fly! Just scan a QR code and edit the fields before adding!
- โ๏ธ Editable Fields - Review and modify account name, secret, digits, and algorithm before saving
- ๐ Smart QR Detection - Automatically scales up small QR codes for reliable decoding
- ๐ญ Single Instance - Prevents running multiple copies because we're not savages
- Open Google Authenticator on your phone
- Tap the three-dot menu (โฎ) in the top right
- Select "Export accounts" or "Transfer accounts"
- Choose "Export accounts" and select the accounts you want to export
- Google Authenticator will display a QR code containing all your accounts
- Take a screenshot of the QR code
- Save the screenshot as
img.pngin the root directory of this repository (same folder assetup.py) - Make sure the image is clearly visible and the QR code is not cropped or distorted
-
Open a terminal/command prompt in the repository root directory
-
Run the setup script:
python setup.py
The script will:
- Install required Python dependencies (protobuf, pyzbar, Pillow)
- Generate the protobuf file needed for parsing migration URLs
- Decode the QR code from
img.png - Extract all your 2FA accounts
- Create
accounts.jsonin thecsharp-tray/AuthenticatorTray/directory - If
accounts.jsonalready exists, it will createupdated_accounts.jsoninstead
-
Navigate to the C# project directory:
cd AuthenticatorTray -
Build the project:
dotnet publish -c Release -r win-x64 /p:PublishSingleFile=true /p:SelfContained=true
- Left-click the tray icon to show all your 2FA codes
- Right-click the tray icon to exit the application
- Click the settings icon (โ๏ธ) in the popup header to add new accounts via QR code
- Codes update automatically every second
The accounts.json file is automatically generated by the setup script from your Google Authenticator export. However, if you need to manually create or edit it, use this format:
{
"accounts": [
{
"name": "Your Bank Account (totally safe)",
"secret": "DEFINITELY_NOT_YOUR_REAL_SECRET",
"digits": 6,
"algorithm": "SHA1"
}
]
}Note: This file is in .gitignore because we learned about security the hard way.
The Easy Way (Recommended):
- When setting up 2FA on a website (e.g., Microsoft, GitHub, etc.), they'll show you a QR code
- Take a screenshot of the QR code (or save it as an image file)
- Left-click the tray icon to open the popup
- Click the settings icon (โ๏ธ) in the popup header
- Click "๐ท Scan QR Code from Image"
- Select your screenshot/image file
- Review and edit the decoded information:
- Name: The display name for the account
- Secret: The Base32-encoded secret key
- Digits: Code length (usually 6, sometimes 7 or 8)
- Algorithm: Hash algorithm (SHA1, SHA256, SHA512, or MD5)
- Click "Add Account" when satisfied
- Done! The new account appears immediately - no rebuild needed!
Features:
- Automatic QR code detection with smart upscaling for small images
- All fields are editable before saving
- Input validation to prevent invalid configurations
- Duplicate account detection with replace option
- Account is automatically saved to
accounts.jsonand persists across restarts
If you prefer to manually add accounts instead of using the export or QR scanning:
- Copy the example file:
cp accounts.json.example accounts.json - Edit
accounts.jsonand add your accounts with their TOTP secrets - Each account needs:
name,secret(base32 encoded),digits(usually 6), andalgorithm(usually "SHA1") - Restart the application to load the new accounts
- โ MVC
- โ MVVM
- โ Repository Pattern
- โ Dependency Injection
- โ The "Everything in Main" Pattern (Patent Pending)
- CSS-like Units:
Em(4.2f)andScreenWidth(22)- we're basically web developers now! - Inline Event Handlers: Because separating concerns is overrated
- Custom Graphics Extensions: Why use existing UI frameworks when you can draw rounded rectangles manually?
- Global State: Static methods everywhere, just like the good old days!
- DPI Awareness:
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2)- look how fancy we are!
- ๐
Hardcoded window positioningNow uses screen percentages like a pro! - ๐
Blurry textCrystal clear DPI-aware rendering! - ๐
Terrible scalingResponsive em-based layout system! - ๐
Need to rebuild to add accountsJust scan a QR code and you're done! - ๐
Can't edit account info before savingAll fields are now editable! - ๐
No QR code validationSmart scaling and comprehensive error messages! - ๐
Multiple app instances runningSingle-instance protection enabled!
- ๐ No error handling for malformed JSON (crashes are features!)
- ๐ Thread safety is for enterprise applications
- ๐ No unit tests (testing is for people who don't believe in their code)
Q: Why does this exist?
A: I was tired of using my phone.
Q: Is this secure?
A: As secure as storing your passwords in a text file named "definitely_not_passwords.txt"
Q: Can I use this in production?
A: You can do many things. Should you? That's between you and your conscience.
Q: Why is everything in one file?
A: Microservices are overrated. We're bringing back the monolith, one giant Program.cs at a time.
Q: Why does it look like macOS?
A: Don't flatter me, it looks like shit.
Found a bug? Great! Here's how you can help:
Fork the repositoryCreate a feature branchWrite tests- Just edit Program.cs directly and add more inline code. It's the way.
This code is released under the "Please Don't Use This In Production" license.
Use at your own risk. I'm not responsible for any security breaches, mental breakdowns, or existential crises that may result from reading or using this code.
"It works on my machine!" - Eric S, 2025