Messaging and social apps · Lesson 3 of 5
Telegram and Signal: what is recoverable
11 min read
Telegram and Signal are often described together as "secure messengers", but for an examiner they are very different. Telegram keeps the full history of ordinary chats on its servers and treats the phone as a cache, while its optional secret chats exist only on two devices. Signal keeps almost nothing on its servers and encrypts its local database with a key held in the phone's secure key store. This lesson explains how each app stores data on Android and iOS and what a full file system extraction can and cannot give you. It also shows where traces survive when the app or its messages are gone, including the notification artifacts that have recovered Signal messages in at least one real case.
Telegram: cloud chats and secret chats
Telegram has two kinds of conversation, and the difference decides where you look.
- Cloud chats are all ordinary one-to-one chats, groups and channels. Telegram's FAQ describes them as protected by server-client encryption: encrypted between each device and Telegram's servers, but stored on the servers so that every device logged in to the account can download the history.
- Secret chats are optional one-to-one chats with end-to-end encryption. Telegram states that they are not part of its cloud and can only be accessed on their devices of origin. They support self-destruct timers.
Two further features affect recovery. In any one-to-one chat, either party can delete any message for both sides, at any time, which removes it from the server and from the other party's devices. And chats can have auto-delete timers. A message absent from both phones may therefore have been deleted by the other party, not the device owner.
Telegram on Android
The official app's package is org.telegram.messenger; other builds use similar names, so check the installed packages. The main database is /data/user/0/org.telegram.messenger/files/cache4.db, a plain SQLite file in Credential Encrypted (CE) storage, with additional accounts in files/account1/ to files/account3/. Important tables in current versions:
| Table | Holds |
|---|---|
| messages_v2 | Messages: mid (message ID), uid (dialog ID), date, out, read_state, send_state, ttl and data |
| dialogs | One row per conversation, keyed by a numeric dialog ID (did), with the time of the last message |
| users and chats | People, groups and channels: numeric ID (uid), name and a serialized record |
| enc_chats | Secret chats: the other party's user ID (user) and the chat's encryption key material |
The date column is Unix time in seconds. The data column is a blob in Telegram's TL (Type Language) serialization, the same format used on the wire: the message text, sender and media references are inside it, so parsing needs a TL-aware tool such as ALEAPP. Secret chat messages are stored in the same messages_v2 table, with dialog IDs marked as encrypted, and their rows remain until the self-destruct timer or a deletion removes them. Conversations are keyed by numeric Telegram IDs, not by phone numbers; a phone number is inside a user's serialized record only when the account can see it.
Downloaded media is in shared storage, usually under Android/data/org.telegram.messenger/files/Telegram/ in folders such as Telegram Images, Telegram Video and Telegram Documents, or under Android/media/org.telegram.messenger/ depending on version and settings; thumbnails and partial downloads sit in the app's cache. A separate database, file_to_path.db, links downloaded files to dialogs and messages.
Remember that cache4.db is a cache. It holds what the app has loaded and kept, limited by the user's cache settings; it is not a complete copy of the account's history. One residual source is in the same file: the unread_push_messages table keeps messages that reached the app as push notifications; the client removes a row when the message is read and on some other events. A row there shows that a message arrived; alone, it does not show that the message was later deleted.
Telegram on iOS
The App Store app (bundle ID ph.telegra.Telegraph) keeps its data in the shared app group container group.ph.telegra.Telegraph, under telegram-data/. Each account has its own folder, telegram-data/account-<number>/, containing postbox/db/db_sqlite (with -wal and -shm files) and postbox/media/ for cached media.
db_sqlite is a key-value store: tables are named t0, t2, t7 and so on, and both keys and values are binary. In published research, t2 holds peers (users, groups, channels) and t7 holds messages, with the chat ID and a Unix-seconds timestamp inside the binary key.
Current versions of the client, whose source code is public, encrypt db_sqlite with SQLCipher. The key and salt (48 bytes) are stored in a file named .tempkey in the telegram-data folder, protected only by iOS Data Protection, and the first 32 bytes of the database are left unencrypted, so the file begins like an ordinary SQLite file. A full file system extraction therefore contains both the database and its key, but a generic SQLite viewer will fail on it; use a tool that reads the key file, and record which tool decrypted it.
Telegram's databases are not included in computer backups or iCloud Backup, so a logical acquisition of an iPhone usually yields no Telegram chats. Secret chats in particular can only come from a full file system extraction of the device where they exist.
What can be recovered from Telegram
- Cloud chats: whatever the app had cached at acquisition time, plus deleted rows that may survive in the WAL file or free pages (lesson 3.2). The full history is on Telegram's servers. Obtaining it means legal process to the provider, whose published policy limits what it discloses, or access to the account through a logged-in device. Such access is a legal and procedural decision and will change the account's state (lesson 2.7).
- Secret chats: only from the two devices involved, while the messages exist. Once a self-destruct timer runs, the rows are deleted, and only database remnants or side traces such as notifications may remain.
- Media: cached files may survive after the message is deleted, or be cleared by the cache limits while the message remains.
Signal
Signal uses end-to-end encryption for all messages and calls. Its servers relay messages and keep very little: Signal's published responses to legal requests show that the only account data it produced were the registration time and the date of last connection. The phone, the linked devices and any backups are therefore the main sources.
Signal on Android
The package is org.thoughtcrime.securesms. Messages are in /data/user/0/org.thoughtcrime.securesms/databases/signal.db, a SQLCipher database. Its key is protected in two layers, as Signal's open-source code shows:
- The database secret is stored in shared_prefs/org.thoughtcrime.securesms_preferences.xml under pref_database_encrypted_secret.
- That value is sealed with AES-GCM using a key named SignalSecret in the Android Keystore, which cannot be exported.
The database can therefore be opened only after the secret is unsealed on the device itself, which an extraction method does by running code as, or on behalf of, the Signal app. Without that step, a copy of signal.db is unreadable. Attachments are stored separately in the app_parts folder and are encrypted with a separate attachment secret.
Inside the decrypted database, the message table holds date_sent and date_received (Unix milliseconds), body, thread_id, from_recipient_id and to_recipient_id, plus flags such as view_once, remote_deleted and expires_in (the disappearing timer, in milliseconds). The thread and recipient tables identify conversations and people. Edited messages are kept as a chain of revisions, so earlier versions may be present.
Signal on iOS
On iOS, the database is grdb/signal.sqlite in Signal's shared app group container (group.org.whispersystems.signal.group). It is also SQLCipher-encrypted; the key is a keychain item, GRDBDatabaseCipherKeySpec, so the extraction must include a keychain dump from the device. Messages are in model_TSInteraction (timestamp and receivedAtTimestamp in Unix milliseconds, body, isViewOnceMessage, wasRemotelyDeleted and expiresInSeconds), with model_TSThread and model_SignalRecipient for conversations and people. Signal excludes its database from computer backups and iCloud Backup.
Backups and linked devices
- Secure Backups, end-to-end encrypted with a 64-character recovery key that Signal never sees, rolled out from late 2025. The free tier covers text messages and the last 45 days of media. View-once messages and messages due to disappear within 24 hours are excluded.
- On-device backups. Current Android versions write each backup as a folder named signal-backup- followed by a UTC date and time, inside a SignalBackups folder at a location the user chooses, encrypted with the recovery key. Older versions wrote a single file named signal- followed by a date and time and ending in .backup, usually in a Signal/Backups folder in shared storage, protected by a 30-digit passphrase that the app showed when backups were turned on. Such files are still found on phones, memory cards and computers, and can be decrypted only with that passphrase. Signal's support pages also describe on-device backups on Signal Desktop, and reporting from September 2026 (Signal for iOS 8.30) describes them on iOS; check the app version before assuming either exists.
- Linked devices: up to five, including Desktop, iPad and, since 2026, a second phone. A newly linked device can receive the message history and the last 45 days of media.
A recovery key or a 30-digit passphrase found written down or stored in a password manager is evidence in itself; record where it came from.
Disappearing messages and notification remnants
Signal's disappearing messages start their timer when a message is sent, for the sender, and when it is read, for the recipient; once it expires the row is deleted. Signal's own help page notes that the feature does not stop a recipient from keeping a copy, for example by photographing the screen.
Notifications are a separate copy of the message that the app does not control once it has been delivered to the operating system. If the user allows message content in notifications (Signal's iOS options are "Name, Content, and Actions", "Name only" and "No Name or Content"), the text of incoming messages passes through the system's notification store.
In April 2026 it became public, through court testimony, that investigators had recovered the content of incoming Signal messages from an iPhone's notification data after the Signal app had been deleted from the phone; only incoming messages were recovered. Apple then released iOS 26.4.2 and iOS 18.7.8 on 22 April 2026, fixing CVE-2026-28950, described as "Notifications marked for deletion could be unexpectedly retained on the device". Three lessons follow:
- Notification data can preserve incoming message content that no longer exists in the app, but only for incoming messages, and only if content was shown.
- What survives depends on the exact iOS version; record it, and treat results from devices before and after the fix (iOS 26.4.2, or 18.7.8 on the iOS 18 branch) differently.
- The same applies to every messaging app. Lesson 4.5 covers iOS notification artifacts, lesson 3.4 covers Android notification history, and lesson 5.5 brings these traces together.
Applying this to the Corvane case
The case evidence points to WhatsApp, but the examiner still lists every messaging app installed on both phones, and the same questions apply to each one found. For Signal on Android, the extraction report must state whether signal.db was decrypted, which requires the Keystore-sealed secret to have been unsealed on the device during acquisition; if it was not, Signal content cannot be read and the report says so. For Telegram on Android, the examiner finds the other party's account in the users table of cache4.db (by name, username or, where the serialized record contains it, phone number) and takes the numeric user ID. The examiner then looks for that ID in dialogs and messages_v2, and in enc_chats (column user) for any secret chat. A cloud chat absent from the phone could still exist on Telegram's servers, or have been deleted for both sides by either party.
Exam focus: Know the difference between Telegram cloud and secret chats and where each can be recovered, the location and nature of cache4.db and db_sqlite, and why Telegram's iOS key file sits beside the database. Know how Signal protects signal.db with a Keystore-sealed secret on Android and a keychain item on iOS, what Signal backups and linked devices contain, and why notification data can preserve message content after deletion.
Practice questions
Check your understanding. These questions do not count towards the exam.
Sign in to save your progress and continue where you left off. It is free. Sign in