Built to order

Android Authenticator App with TOTP Codes and QR Setup

This project builds an Android authenticator app that generates 6-digit time-based one-time passwords (TOTP) for multiple accounts, following RFC 6238 with a 30-second step and HMAC-SHA-1. Accounts are added by scanning the QR code a website shows when two-factor authentication is switched on, or by typing the setup key by hand. Secrets stay encrypted on the phone, codes work offline, and an encrypted backup restores every account on a new device. Suitable for B.E./B.Tech final-year projects in Computer Science, IT and Android application development.

Chat on WhatsApp — get a quotation

Android GitKotlinMaterial Design 3Android StudioAndroid Jetpack Room DatabaseEncryptedSharedPreferences Android KeystoreZXing barcode librarySoftware
Android Authenticator App with TOTP Codes and QR Setup — project thumbnail preview
More project photos (2)

The problem

Passwords alone no longer protect student and staff accounts: one leaked password opens email, cloud storage and college portals, while SMS codes arrive late, fail without signal and can be intercepted. An authenticator app fixes the weak link by generating a fresh six-digit code on the phone itself every thirty seconds, so a stolen password alone is useless at login. This project builds exactly such an app for Android: AuthVault implements the TOTP standard from RFC 6238, adds accounts by scanning the QR code a website shows when two-factor authentication is switched on, stores each account secret encrypted on the device, and restores every account from one encrypted backup file. Building it teaches the real mechanism behind the apps students already use — HMAC-SHA-1, time-step counters, Base32 secrets and Android encrypted storage — instead of treating two-factor authentication as a black box.

SYSTEM FLOW

5 components 4 connections

Live flow
Drag to explore
100%
userQR Setup Code

The service shows a QR code that carries the account secret.

Follow the working sequence

How it works

Setting up and using the app follows one short chain from the website to the login screen. The user switches on two-factor authentication on a website, which shows a QR code holding an otpauth link with the issuer, account name and Base32 secret; AuthVault scans that code and stores the secret encrypted on the phone, or the user types the setup key by hand. From then on the app divides the current Unix time by the thirty-second step to get a counter, runs HMAC-SHA-1 over that counter with the secret, truncates the result to six digits and shows the code with a countdown ring. The user copies the code into the website login prompt before the ring runs out; the site runs the same calculation and accepts the match. An encrypted backup file preserves every secret, so a new phone restores all accounts without re-scanning each site.

  1. Switch on two-factor authentication on the website; it displays a QR code holding an otpauth link with the issuer, account name and Base32 secret.
  2. Scan the QR code in AuthVault, or type the setup key manually; the app parses the issuer, account name and secret and saves the account.
  3. The secret is stored in Android EncryptedSharedPreferences backed by the Android Keystore — never in plain text and never uploaded to any server.
  4. Every second the app computes the current 30-second time step, T = floor(Unix time / 30), for each account.
  5. For each account it computes HMAC-SHA-1 of that counter keyed with the secret, applies the RFC 4226 dynamic truncation, and takes the result modulo 1,000,000 to produce a 6-digit code.
  6. Codes display beside a countdown ring; tapping a code copies it, and the user pastes it into the website login prompt before the 30-second window ends.
  7. The website runs the same calculation with the same secret and accepts the code when it matches, typically allowing one time step either side for clock drift.
  8. For backup, the app exports all secrets into one AES-256 encrypted file; on a new phone the file plus the backup password restores every account without re-scanning each site.

Tech stack:

  • Kotlin
  • Android Studio
  • Android Jetpack · Room database
  • EncryptedSharedPreferences · Android Keystore
  • ZXing barcode library
  • HMAC-SHA-1 · RFC 6238 TOTP
  • Material Design 3
  • Git
Parameter Value
Code length 6 digits (RFC 6238 default)
Time step 30 seconds (RFC 6238 default)
Hash function HMAC-SHA-1 (RFC 6238 default)
Time-step counter T = floor(Unix time / 30) (RFC 6238)
Setup-key format Base32 (RFC 4648)
Accounts supported Up to 100 accounts (design target)
Secret storage AES-256 encrypted (Android Keystore)
Backup file size Approximately 1.8 KB for 6 accounts (demo export)
Backup restore time Under 10 seconds for 6 accounts (design target)
Minimum Android version Android 8.0 · API level 26 (design target)
Code generation Offline — no network call (standard behaviour)
Clock-drift tolerance 1 time step either side (server-side, RFC 6238 recommendation)

Project features

The app is built around four capabilities that work together as one login companion. First, live TOTP generation: every account shows a fresh six-digit code that refreshes every thirty seconds, computed on the phone from the account secret and the current time step, with a countdown ring showing how long the code stays valid. Second, fast setup: scanning a website QR code adds an account in seconds, with manual setup-key entry as the fallback when a camera is unavailable. Third, encrypted storage and backup: secrets live in Android encrypted storage, and one encrypted backup file restores every account on a replacement phone. Fourth, a biometric lock keeps the codes behind a fingerprint, with auto-lock when the app leaves the foreground. A fifth thread runs through all of them: everything works offline, because a code generator that needs a network connection would fail exactly when a login is urgent.

  • [Live TOTP code generation] Each account shows a fresh 6-digit code computed on-device from its secret and the current 30-second time step, with a countdown ring showing how many seconds the code stays valid. Codes are generated by the app's own RFC 6238 implementation and verified against the RFC test vectors during the build.
  • [QR-code account setup] Scanning the QR code a website shows when two-factor authentication is switched on adds the account in seconds. The app parses the otpauth link for issuer, account name and Base32 secret, and shows a scan frame with a moving scan line while the camera is active.
  • [Manual setup-key entry] When no camera is available, the setup key shown by the website can be typed in by hand. The app validates the Base32 key before saving, so a mistyped key is caught at entry instead of producing wrong codes at login.
  • [Encrypted local secret storage] Every account secret is stored in Android EncryptedSharedPreferences backed by the Android Keystore, never in plain text and never uploaded to any server. Deleting the app deletes the secrets with it, so the backup file is the only recovery path.
  • [Encrypted backup and restore] All accounts export into one AES-256 encrypted backup file protected by a backup password, and importing that file on a new phone restores every account at once. The demo build exports 6 accounts into a file of approximately 1.8 KB.
  • [Biometric app lock and auto-lock] A fingerprint lock guards the app on every open, and the app locks itself automatically after 30 seconds in the background. Codes can also be hidden on the lock screen, so a glance at a locked phone reveals nothing.
  • [Multiple accounts with search and tap-to-copy] The home screen lists every account with its current code, supports search across accounts, and copies a code with one tap. The build is designed for up to 100 accounts, far beyond the handful most students use.

Implemented in the base build: live TOTP generation, QR setup, manual key entry, encrypted storage, encrypted backup and restore, biometric lock with auto-lock, and the multi-account list. Optional on request: per-account custom code length and hash choice, and a dark theme. Future scope, not included: cloud sync of secrets and a desktop companion app.

What is included

  • Complete Android source code in Kotlin with the RFC 6238 TOTP implementation
  • Working demo build of the app with the accounts list, QR setup screen and settings/backup screen
  • QR setup and manual key-entry flow with otpauth link parsing
  • Encrypted storage and encrypted backup/restore implementation
  • Project report PDF (background, TOTP theory, RFC 6238 walkthrough, methodology, results)
  • PPT presentation for final review
  • Viva Q&A preparation document (TOTP, HMAC, time steps, Base32, Android Keystore, backup design)
  • Quotation on WhatsApp — share the scope (accounts, backup, lock options), your timeline and college format, and the build is prepared to order.

Limitations & prerequisites

  • Codes depend on the phone clock: if the clock drifts by more than about 60 seconds from the server, codes stop matching until the clock is corrected.
  • Losing the phone without an encrypted backup means every account must be re-enrolled on each website — the app cannot recover secrets it never stored anywhere else.
  • A forgotten backup password cannot be reset: the encrypted backup file is unreadable without it, by design.
  • TOTP codes are not phishing-resistant — a code typed into a fake login page can be relayed by the attacker, so the report states this limit honestly.
  • The RFC 6238 default is HMAC-SHA-1 with 6 digits; some sites use SHA-256 or 8 digits, and support for those variants is an optional extension, not in the base build.
  • Biometric unlock depends on the phone having a fingerprint sensor; on devices without one the app falls back to a PIN lock.
  • The app stores no data in the cloud, so there is no way to sync accounts between two phones except through the encrypted backup file.

Frequently Asked Questions

How does the app generate a code without internet?

The code is not fetched from anywhere — it is computed on the phone from two things the app already holds: the account secret and the current time. The app divides the current Unix time by the 30-second step to get a counter, runs HMAC-SHA-1 over that counter with the secret, and truncates the result to six digits. The website runs the same calculation with the same secret, so both sides agree without ever communicating. That is the whole point of TOTP: time itself is the shared counter.

How do I add an account with the QR code?

Switch on two-factor authentication on the website and it shows a QR code; open AuthVault, tap the add button and point the camera at the code. The QR holds an otpauth link with the issuer, account name and Base32 secret, and the app parses it and saves the account in seconds. If the camera is unavailable, the same setup key is shown as text on the website and can be typed in by hand, with the app validating the key before saving.

What happens if I lose my phone?

If you exported an encrypted backup, you restore it on the new phone with the backup password and every account comes back at once — no re-scanning needed. If you never made a backup, the secrets are gone with the phone, because they were stored only on the device and never uploaded anywhere. Each website then needs its own recovery process, usually a backup code or support request. The report's setup guide walks through making the first backup before the app is used for real accounts.

Is my secret key safe if someone steals my phone?

Yes, within the limits of the device itself: secrets live in Android EncryptedSharedPreferences backed by the Android Keystore, so they are not readable as plain text from the app's files. The biometric lock and auto-lock add a second barrier — the codes are not visible without unlocking the phone. A thief with the unlocked phone or the backup password could still reach the codes, so the backup password must be kept separate from the phone.

Is this project suitable for a final-year project?

Yes — for Computer Science, IT and Android-focused programs, because the project combines applied cryptography with real Android platform work in one complete, demonstrable product. It demonstrates applied cryptography (HMAC, time-based codes), Android platform skills (encrypted storage, Keystore, camera and QR scanning, biometrics), and a complete product flow from setup to backup. The RFC 6238 walkthrough in the report gives the student a standards-based story to defend in the viva, and the working demo makes the mechanism visible instead of theoretical.

Components & software requirements
  • Kotlin
  • Android Studio
  • Android Jetpack · Room database
  • EncryptedSharedPreferences · Android Keystore
  • ZXing barcode library
  • HMAC-SHA-1 · RFC 6238 TOTP
  • Material Design 3
  • Git
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Get a quotation