Tools & utilities

Build a photo vault app with AI

A private photo vault build brief: fingerprint or Face ID to open, files encrypted inside the app, and no screenshots of the vault screens.

Apirex TeamUpdated AndroidiOS
On this page
  1. Screens
  2. Data model
  3. Native features
  4. Android notes (Kotlin and Jetpack Compose)
  5. iPhone notes (Swift and SwiftUI)
  6. Copy-paste prompt
  7. Acceptance test
  8. Frequently asked questions
5screens
3data tables
152word prompt
2platforms: Android, iOS

A photo vault is the app you build because a sibling keeps scrolling through your gallery. This brief keeps chosen photos and files inside the app, encrypted with a key held by the phone’s secure hardware, and opens only after fingerprint, face or a device passcode. Android is the best first target: BiometricPrompt, the Android Keystore and a screenshot block on vault screens are all standard there. An iPhone build is also realistic with Face ID and the Keychain, but it needs a Mac with Xcode. The first proof is simple: import one photo, lock the app, fail to see it without unlocking, then open it after a successful biometric check.

Screens

  • Lock: Biometric prompt with a device-credential fallback and nothing from the vault visible behind it.
  • Vault grid: Thumbnails of imported items, decrypted only in memory while unlocked.
  • Import: Pick photos or files with the system picker and copy them into encrypted storage.
  • Viewer: Full-size photo with Export and Delete, blocked from screenshots and the recent-apps preview.
  • Settings: Auto-lock delay, whether to remove originals after import, and a clear warning about losing access.

Data model

Vault records kept on the device
TableKey fieldsPurpose
vault_itemsid (uuid), display_name (text), mime_type (text), size_bytes (int), imported_at (timestamptz)An index of what is in the vault; the name itself can be encrypted too.
blobsitem_id (uuid), cipher_path (text), iv (blob)Where the encrypted file lives in app-private storage and the nonce used for it.
settingsauto_lock_seconds (int), delete_original (bool)Lock behaviour the owner chooses, stored locally.

There is no account and no server in this version, and the brief should keep it that way: the whole point is that the files exist only on this phone. Each item is encrypted with AES-GCM using a key generated inside the Keystore or Secure Enclave and flagged to require user authentication. Uninstalling the app or wiping biometrics can make the files unrecoverable, and the app must say so before the first import. Removing the original from the gallery is optional and needs the user’s explicit confirmation through the system delete request.

Native features

Three platform pieces carry this app: the system biometric prompt, a hardware-backed key, and a way to stop the vault from appearing in screenshots or the app switcher.

FeatureAndroid (Kotlin)iPhone (SwiftUI)Notes
UnlockBiometricPrompt with BIOMETRIC_STRONG or DEVICE_CREDENTIALLocalAuthentication LAContextA cancelled or failed prompt leaves the vault locked with no partial content shown.
Encryption keyAndroid Keystore AES key with setUserAuthenticationRequiredKeychain item protected by Secure Enclave access controlThe key never leaves secure hardware and is never written to a file.
Hide from capturesWindowManager FLAG_SECURE on vault activitiesBlur overlay when scenePhase becomes inactiveAndroid blocks screenshots outright; iOS can only cover the app-switcher snapshot and detect captures.

Android notes (Kotlin and Jetpack Compose)

Set FLAG_SECURE on the activity before any vault composable draws. Keep an unlocked-until timestamp in the ViewModel and return to the Lock screen from a lifecycle observer when the app goes to the background longer than the chosen delay.

  • Import through the Photo Picker or OpenMultipleDocuments, stream each file through a Cipher in AES/GCM/NoPadding mode into filesDir, and record the IV in Room. Never write a decrypted temporary copy to cache.
  • Show thumbnails in a LazyVerticalGrid by decrypting a downscaled bitmap into memory; clear the in-memory cache when the vault locks.
  • Biometrics need a real phone with an enrolled fingerprint. Import two photos, take a screenshot attempt on the grid, check the recent-apps card is blank, then lock and confirm the files in app storage are unreadable without the key.

iPhone notes (Swift and SwiftUI)

Gate the root view on an authenticated flag set by LAContext.evaluatePolicy, and reset it whenever scenePhase moves to background. Store item metadata in SwiftData and encrypted blobs in the app container with complete file protection.

  • Encrypt with CryptoKit AES.GCM using a symmetric key wrapped by a Secure Enclave key, and add NSFaceIDUsageDescription with an honest one-line reason.
  • Cover the window with a blurred view when the app becomes inactive so the app switcher never shows a private photo; observe the screenshot notification to warn the user, since iOS cannot block it.
  • Face ID can be simulated in the iOS Simulator, but test the full flow on a physical iPhone too: deny Face ID permission, use the passcode fallback, and verify the vault still opens only after authentication.

Copy-paste prompt

Build this yourself 150 words · Android
My brother keeps going through my gallery. Build me a secret photo vault app for Android that hides my private photos and files and only opens with my fingerprint or Face ID. Screens: Lock, Vault grid, Import, Viewer, Settings. No account and no cloud: everything stays on this phone. Import with the system picker, encrypt each file with AES-GCM using a key kept in the Android Keystore or Secure Enclave that needs my biometric to unlock, and never leave a decrypted copy on disk. Block screenshots on vault screens where the platform allows it and hide the app-switcher preview. Auto-lock after a delay I choose. Ask before deleting originals from the gallery and warn me that uninstalling can lose the files. Handle a cancelled or failed unlock, no biometrics enrolled, a huge video, a full disk and an empty vault. Explain what you could only verify on a real phone.

Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.

Acceptance test

  1. Open the app on a phone with a fingerprint or face enrolled and confirm nothing from the vault shows before unlocking.
  2. Import three photos, close the app, reopen and unlock; confirm all three thumbnails and full-size views load.
  3. Try a screenshot on the Viewer and open the recent-apps screen; confirm the content is blocked or covered.
  4. Cancel the biometric prompt twice and confirm the vault stays locked with a clear retry option.
  5. Copy the app’s stored files off a debug build and confirm they cannot be opened as images.

Delete one item and confirm both its index row and its encrypted file are gone, not just hidden from the grid. Then remove all enrolled fingerprints from system settings and reopen: the app should explain that the key is no longer usable rather than pretend the files are fine or crash on launch.

Frequently asked questions

Can I back up the vault?

Not in this version, by design. A backup needs its own export key and a place to store it, which changes the privacy promise. Add it later as a deliberate, password-protected export.

Is this the same as a locked notes app?

No. The notes and journal blueprints protect text you write; this vault protects photos and files you import, with encryption at rest rather than only a lock screen.

Will hidden photos disappear from my gallery?

Only if you allow it. The app asks before removing originals, and the system shows its own confirmation for the delete.

Build this blueprint

The blueprint prompt, ready for your platform. Edit anything before you send it.

AndroidKotlin · Jetpack ComposeReal source on your computer

Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.