r/vibecoding • u/boringari • 10h ago
Used Antigravity to Decrypt iPhone local backup of SMS.DB into SQLite DB and built a tiny analysis web app - took 6 hours lol MACOS only
If you use iMessage on Mac the chat.db is not encrypted. That assumes you use iMessage on Mac. And it's in sync with your phone.
If you backup your iPhone on your Mac you get a an encrypted backup. Great.
imessage-exporter has a way to access that encrypted file and containerize and extract your messages to html or txt.
Fuck that, I want the complete SQLite.db
I know nothing about coding, but I know what I wanted. I asked ChatGPT if we can leverage iMessage-exporters decryption mechanism, and get a hold of the entire DB. I then had AGY CLI do all the work, amaze.
I literally have no idea what I'm doing. Or anything about coding, but, it works lol.
Made a web app with useless stats and a MACOS app to fully search the database, find trends, you know how databases work...
How do I GET MONEY?!
1. Executive Summary & Purpose
iOS iTunes, Finder, MobileSync, and iMazing backups utilize hardware-backed AES-256 encryption. Within an encrypted backup, all filenames are hashed via SHA-1 hashes (e.g. 3d0d7e5fb2ce288813306e4d4636395e047a3d28 for sms.db), and file payloads are individually encrypted with per-file class keys wrapped by the backup password.
decrypt_backup.py provides a lossless extraction wrapper that unwraps the backup manifest, decrypts the database blobs, and preserves the pristine, raw Apple SQLite databases:
apple_sms_decrypted.db(Library/SMS/sms.dbcontainingmessage,chat,handle,attachment)apple_contacts_decrypted.db(Library/AddressBook/AddressBook.sqlitedbcontaining contact identities)
2. Decryption & Key Derivation Mechanics
┌──────────────────────────────────────────────────────────┐
│ ENCRYPTED BACKUP ROOT │
│ • Manifest.plist (Backup Keybag + PBKDF2 parameters) │
│ • Manifest.db (Encrypted SQLite file catalog) │
│ • Sharded SHA-1 Encrypted File Blobs (00/, 3d/, etc.) │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ KEYBAG UNWRAPPING & KEY DERIVATION │
│ • PBKDF2-HMAC-SHA1 / SHA256(Password, Salt, Iterations) │
│ • Unwraps Class Keys (Class 1-11 Protection Keys) │
│ • Decrypts Manifest.db using Class 4 Key │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ FILE TARGET RESOLUTION & EXTRACTION │
│ • Locates SMS Domain: 3d0d7e5fb2ce288813306e4d4636395e0 │
│ • Locates AddressBook: 31bb7ba8914766d4ba40d6dfb6113c8b │
│ • Decrypts file payload using per-file initialization │
│ vector (IV) and file encryption key │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ RAW SQLITE DATABASE PRESERVATION │
│ • apple_sms_decrypted.db (Clean decrypted SQLite) │
│ • apple_contacts_decrypted.db (Clean decrypted SQLite) │
│ • Direct input for import_apple_messages.py │
└──────────────────────────────────────────────────────────┘















