跳到正文
DEV Community· mincho milev·· 1 小時前AI 評分35

為何 iPhone「隱藏相簿」未有加密,以及 PhotoVault 如何打造零雲端 AES-256-GCM 保險庫(.pvsecure)

Why iPhone's Hidden Album Isn't Encrypted—and How We Built a Zero-Cloud AES-256-GCM Vault (.pvsecure)

AI 導讀

PhotoVault: Encrypt & Compress 採用無帳戶、零伺服器架構,打造以 AES-256-GCM 加密的 iPhone 相片保險庫,並以獨立密碼或 5×5 圖案與 iPhone 密碼分開。Compact Mode 將 313.3 MB 相片集壓縮至 122.7 MB,縮減逾 60%。.pvsecure 檔案支援離線裝置間遷移,收據文字 OCR 則在裝置上離線搜尋。

正文

mincho milev

Every week people assume locking Apple Photos' Hidden Album protects private IDs, medical scans, financial receipts, and personal videos. Under the hood, however, the Hidden Album shares the exact same device passcode as the iPhone lock screen—meaning anyone who knows or shoulder-surfs your phone's unlock PIN opens your Hidden Album in two seconds—and iCloud Photos sync replicates those files off-device unless disabled globally.

When building PhotoVault: Encrypt & Compress (App Store id6824412013 for iPhone & iPad on iOS 18+), we wanted an accountless, zero-server architecture that solves three hard engineering constraints simultaneously:

  1. True At-Rest AES-256-GCM Encryption with an independent Password or 5×5 Pattern (separate from the iPhone passcode) and zero cloud key escrow.
  2. 60%+ Storage Reduction in Compact Mode (shrinking a 313.3 MB camera-roll set down to a 122.7 MB encrypted container via hardware VideoToolbox HEVC, alongside bit-exact Lossless Mode).
  3. Offline Device-to-Device Migration (.pvsecure) + On-Device Vision OCR so users can search printed text inside encrypted receipts and contracts with zero network requests.

We also published the wire-format specification in our open documentation repo: https://github.com/minchopm/pvsecure-spec.


1. Separating Vault Credentials From the Device Passcode

A common mistake in mobile "folder hider" apps is storing raw JPEGs in the app's sandbox Documents/ directory behind a UI-only PIN screen. Anyone backing up an unencrypted Finder/iTunes snapshot or inspecting the sandbox sees plaintext media.

In PhotoVault:

  • Media payloads and the searchable metadata index are encrypted on disk with AES-256-GCM via Apple CryptoKit.
  • The per-installation symmetric key is sealed with kSecAttrAccessibleWhenUnlockedThisDeviceOnly so it never leaves the physical iPhone's Secure Enclave-backed Keychain.
  • Users can configure an independent Password or 5×5 Pattern (in addition to Face ID / Touch ID) that locks immediately whenever scenePhase leaves .active. See our full breakdown: iPhone Hidden Album vs. True Encrypted Photo Vault.

2. Portable .pvsecure Archives (PBKDF2-HMAC-SHA256 + AES-256-GCM)

Zero cloud servers creates an obvious UX question: How do I move 20 GB of encrypted family videos to a new iPhone without uploading them to iCloud or Keepsafe's cloud?

PhotoVault's Secure Share exports a standalone .pvsecure file derived from a user-chosen Password or 5×5 Pattern:

  • 32-byte CSPRNG salt (SecRandomCopyBytes) + PBKDF2-HMAC-SHA256 (210,000+ iterations) derives a 256-bit key.
  • 96-bit nonce + 128-bit GCM authentication tag guarantees full integrity verification before a single byte is unpacked during Secure Import over AirDrop, Files, or USB-C drive.

3. Running Searchable Receipt OCR 100% Offline

Cloud photo managers index your receipts and ID cards on remote GPUs. On Apple silicon iPhones (iOS 18+), VNRecognizeTextRequest (.accurate recognition level with automatic language detection) extracts printed text locally in milliseconds:

  • PhotoVault normalizes HDR/wide-gamut frames to 8-bit sRGB buffers in memory, runs Vision OCR + barcode detection locally, and writes the tokens straight into the encrypted on-device index—zero external API calls, zero ad SDKs, and zero telemetry.

If you're comparing local-first iOS vaults against cloud subscription lockers, check out our 2026 Encrypted iPhone Photo Vault Comparison Matrix or try PhotoVault: Encrypt & Compress on the App Store.

來源:DEV Community · dev.to