Skip to Content
Disappearing Messages

Disappearing Messages

Technical specification for automatic message expiration and secure deletion in Zentalk.

Overview

Disappearing messages provide an additional layer of privacy by automatically deleting messages after a specified time period. This feature ensures that sensitive conversations do not persist indefinitely on devices, reducing the risk of data exposure from device theft, unauthorized access, or forensic analysis.

Privacy Benefits

BenefitDescription
Reduced data exposureMessages automatically removed after expiration
Limited forensic surfaceLess recoverable data on device storage
Conversation ephemeralityMimics in-person conversation impermanence
Storage managementAutomatic cleanup of old messages
Relationship privacyEx-partners, former colleagues cannot review old messages

Available Timer Options

Timer DurationUse Case
1 hourHighly sensitive, time-critical information
24 hoursDay-to-day sensitive conversations
7 daysGeneral privacy-conscious messaging
30 daysLong-form discussions with eventual cleanup
Custom (1 min - 365 days)User-defined expiration requirements

Timer Configuration

Timer Settings Payload: ┌─────────────────────────────────────────┐ │ Timer Mode (1 byte) │ │ 0x00 = Disabled │ │ 0x01 = After Send │ │ 0x02 = After Read │ ├─────────────────────────────────────────┤ │ Duration (4 bytes, uint32) │ │ Value in seconds │ │ Range: 60 - 31536000 (1 min - 1 year) │ ├─────────────────────────────────────────┤ │ Timestamp (8 bytes) │ │ Unix timestamp of setting change │ └─────────────────────────────────────────┘

Timer Mechanism

Zentalk implements disappearing messages with client-side timer enforcement. The server has no knowledge of timer settings or expiration times, ensuring that message lifecycle remains under user control.

Timer Start Modes

ModeTimer StartsUse Case
After SendWhen message leaves sender deviceGuaranteed maximum lifetime
After ReadWhen recipient opens messageEnsures recipient sees message

Client-Side Timer Implementation

Timer Lifecycle: 1. Sender sets disappearing timer for conversation timer_setting = { mode: AFTER_READ, duration: 86400 } 2. Message created with embedded timer: message.timer = encrypt(timer_setting, session_key) message.send_timestamp = current_time() 3. Recipient receives and decrypts message: timer_setting = decrypt(message.timer, session_key) 4. Timer activation: IF timer_setting.mode == AFTER_SEND: expiration = message.send_timestamp + timer_setting.duration ELSE IF timer_setting.mode == AFTER_READ: expiration = read_timestamp + timer_setting.duration 5. Client schedules deletion: schedule_deletion(message_id, expiration)

Timer Synchronization Between Devices

All linked devices maintain synchronized timer state through the multi-device sync protocol:

Sync EventAction
Timer setting changedBroadcast encrypted setting to all devices
Message readSync read receipt with timestamp
Message deletedSync deletion confirmation
Device reconnectReconcile timer states
Timer Sync Protocol: Device A (sender): 1. Sets timer for conversation with Bob 2. Encrypts timer setting with self-sync key 3. Broadcasts to Device B, Device C (own devices) Device B receives: 1. Decrypts timer setting 2. Updates local conversation settings 3. Applies to future messages 4. Sends ACK to Device A Conflict Resolution: - Latest timestamp wins - Vector clock prevents race conditions

Expiration Enforcement

When a message timer expires, Zentalk performs secure deletion to minimize data recovery possibilities.

Deletion Trigger Process

StepActionVerification
1Timer expiresClient-side scheduler fires
2Verify message existsCheck local database
3Delete message contentSecure overwrite
4Delete associated mediaRemove from cache and storage
5Delete metadataRemove timestamps, sender info
6Sync deletionNotify other devices
7Confirm deletionUpdate conversation view

What Gets Deleted

Data TypeDeletion ScopeMethod
Message textFull contentSecure overwrite
Media filesOriginal + thumbnailsSecure overwrite
MetadataTimestamps, message IDDatabase row removal
Read receiptsAssociated receiptsCascade delete
ReactionsEmoji reactionsCascade delete
Reply referencesQuote previewsNullify or delete
Search indexMessage tokensIndex removal

Secure Deletion Implementation

Secure Deletion Process: 1. Identify target data locations: - IndexedDB message store - File system cache (media) - In-memory buffers - Search index entries 2. For each storage location: Database Records: - Overwrite content with random bytes - Update record with null values - Delete record from table - Trigger index rebuild File System: - Overwrite file with random data (3 passes) - Truncate file to zero length - Unlink file from filesystem - Request secure delete from OS (where available) Memory: - Zero memory buffers - Release memory to allocator - Request garbage collection 3. Verification: - Attempt to read deleted data - Confirm retrieval fails - Log deletion completion

Platform-Specific Secure Deletion

PlatformSecure Delete MethodLimitations
iOSNSFileManager with NSFileProtectionCompleteSSD wear leveling
AndroidFile.delete() + explicit overwriteFlash storage copies
Desktop (Electron)Node.js unlink + overwriteSSD block mapping
WebIndexedDB deleteBrowser storage management

Encryption of Timer Settings

Timer settings are encrypted within the message payload, preventing server-side manipulation or observation.

Timer Value Encryption

ComponentEncryptionKey Source
Timer modeAES-256-GCMSession key
Duration valueAES-256-GCMSession key
TimestampAES-256-GCMSession key

Encrypted Timer Structure

Message Payload with Timer: ┌─────────────────────────────────────────┐ │ Header │ ├─────────────────────────────────────────┤ │ Encrypted Content │ │ ├── Message Text │ │ ├── Timer Settings (encrypted) │ │ │ ├── Mode (1 byte) │ │ │ ├── Duration (4 bytes) │ │ │ └── Set Timestamp (8 bytes) │ │ └── Media References │ ├─────────────────────────────────────────┤ │ Authentication Tag (16 bytes) │ └─────────────────────────────────────────┘ The timer settings are: 1. Included in encrypted payload 2. Covered by AEAD authentication 3. Cannot be read by server 4. Cannot be modified without detection

Server Cannot Modify Timer

Attack VectorPrevention Mechanism
Server reads timerTimer encrypted with session key
Server extends timerAEAD tag verification fails
Server shortens timerAEAD tag verification fails
Server removes timerAEAD tag verification fails
Replay with old timerSequence number mismatch

MAC Authentication

Timer Authentication: 1. Timer included in AEAD associated data: AD = message_id || sender_id || sequence_num || timer_blob 2. Encryption: ciphertext, tag = AES-256-GCM( key = session_key, nonce = unique_nonce, plaintext = message_content || timer_settings, associated_data = AD ) 3. Recipient verification: - Decrypt with session key - Verify tag matches - Any modification invalidates tag - Reject message if verification fails

Multi-Device Behavior

Disappearing messages must behave consistently across all linked devices while handling offline scenarios.

Timer Sync Across Devices

ScenarioBehavior
Timer set on Device ASynced to B, C via encrypted channel
Message received on Device A firstA starts timer, syncs to B, C
Timer expires on Device ADeletion synced to B, C
Devices have clock skewUse sender timestamp as reference

Offline Device Handling

Offline Expiration Scenario: Timeline: T+0: Message sent to Alice (timer: 24h) T+1h: Alice reads on Phone (timer starts) T+2h: Alice's Tablet goes offline T+25h: Timer expires on Phone T+25h: Phone deletes message T+48h: Tablet comes online Tablet Reconnection: 1. Tablet syncs with Phone 2. Receives deletion sync record 3. Verifies message should be deleted 4. Performs catch-up deletion 5. Confirms deletion to sync service

Catch-Up Deletion on Reconnect

StepActionData
1Device reconnectsEstablish sync session
2Fetch deletion logMessage IDs + deletion timestamps
3Compare local stateIdentify messages to delete
4Execute deletionsSecure delete each message
5Confirm syncUpdate deletion log
6Prune deletion logRemove entries older than 30 days

Deletion Log Structure

Deletion Log Entry: ┌─────────────────────────────────────────┐ │ Message ID (32 bytes) │ ├─────────────────────────────────────────┤ │ Conversation ID (32 bytes) │ ├─────────────────────────────────────────┤ │ Deletion Timestamp (8 bytes) │ ├─────────────────────────────────────────┤ │ Deletion Reason (1 byte) │ │ 0x01 = Timer expired │ │ 0x02 = User deleted │ │ 0x03 = Admin deleted (groups) │ ├─────────────────────────────────────────┤ │ Signature (64 bytes) │ └─────────────────────────────────────────┘ Log entries are: - Encrypted with device sync key - Retained for 30 days - Used for offline device catch-up - Pruned after all devices confirm

Group Chat Disappearing Messages

Group chats support disappearing messages with additional considerations for multi-party settings.

Per-Group Timer Settings

Setting LevelScopePersistence
Group defaultAll messages in groupUntil changed
Per-message overrideSingle messageMessage lifetime
Member preferenceDisplay onlyLocal to device

Permission Model

RoleCan View TimerCan Change TimerCan Override
OwnerYesYesYes
AdminYesYesConfigurable
MemberYesNo (default)No
GuestYesNoNo

Admin-Only Timer Control

Group Timer Change Protocol: 1. Admin initiates timer change: new_timer = { mode: AFTER_READ, duration: 86400 } 2. Create setting update message: update = { type: GROUP_SETTING_CHANGE, setting: DISAPPEARING_TIMER, value: new_timer, admin_signature: sign(admin_key, update_payload) } 3. Distribute via Sender Keys: - Encrypt with admin's Sender Key - Broadcast to group - All members receive and verify 4. Member verification: - Verify admin signature - Verify admin has permission - Apply new setting locally - Future messages use new timer

New Member Joins After Timer Set

ScenarioBehavior
Member joins group with timerReceives current timer setting
Existing messagesNot accessible (forward secrecy)
New messagesSubject to group timer
Timer changed after joinReceives update via group sync
New Member Timer Handling: 1. New member receives group state: group_state = { members: [...], settings: { disappearing_timer: { mode: AFTER_READ, duration: 3600 } }, sender_keys: [...] } 2. Member stores timer setting locally 3. For each new message received: - Extract timer from encrypted payload - Verify matches group setting - Schedule deletion accordingly 4. For messages sent: - Embed group timer in message - Encrypt with Sender Key - Other members honor sender's timer

Media and Attachments

Media files require special handling for disappearing messages due to their distributed storage.

Media Chunk Deletion

Storage LocationDeletion MethodTiming
Local device cacheSecure overwriteOn timer expiry
Mesh storage nodesDeletion requestPropagated async
CDN cache (if used)TTL expirationBest effort
Recipient devicesSecure overwriteSynced deletion

Media Deletion Process

Media Disappearing Flow: 1. Original upload: - Media chunked and encrypted - Chunks distributed to mesh nodes - Chunk IDs stored in message 2. Timer expires: - Delete local cached copy - Send deletion request to mesh - Request propagates to storage nodes - Nodes mark chunks for deletion 3. Mesh deletion: - Storage nodes receive deletion request - Verify request signature (from sender) - Mark chunks as deleted - Actual deletion on next garbage collection 4. Verification: - Attempt to fetch chunks fails - 404 response from mesh nodes - Deletion confirmed

Thumbnail Deletion

Thumbnail TypeStorageDeletion
Message previewLocal databaseWith message
Gallery cacheFile systemOn timer expiry
Notification previewOS notification systemBest effort
Link previewLocal cacheWith message

Cached Preview Cleanup

Preview Cleanup Process: 1. Identify all cached previews: - Image thumbnails (various sizes) - Video thumbnails (first frame) - Audio waveforms - Document previews - Link previews with images 2. For each preview type: - Locate cache directory - Find files matching message ID - Secure delete each file - Update cache index 3. Platform-specific cleanup: - iOS: Clear NSCache entries - Android: Clear Glide/Picasso cache - Desktop: Clear Electron cache directory - Web: Clear Cache API entries

Backup Implications

Disappearing messages interact with the backup system in specific ways to maintain privacy guarantees.

Backup Exclusion

Data TypeIncluded in BackupReason
Active messages (no timer)YesNormal backup
Messages with active timerNoWould defeat purpose
Expired messagesNoAlready deleted
Timer settingsYesRestore conversation settings
Deletion logNoTransient sync data

Backup Timing Considerations

Backup and Disappearing Messages: Scenario 1: Message expires before backup T+0: Message received (timer: 1h) T+1h: Message expires, deleted T+24h: Daily backup runs Result: Message not in backup (correct) Scenario 2: Message expires after backup T+0: Message received (timer: 48h) T+24h: Daily backup runs T+48h: Message expires, deleted Result: Message in backup (problematic) Mitigation: - Backup process checks timer expiration - Messages with timer ≤ backup_interval excluded - Backup metadata includes "disappearing excluded" flag

Pre-Expiration Backup Handling

ScenarioSystem Behavior
Backup made before expirationMessage excluded from backup
Restore from backupDisappearing messages not restored
Timer setting restoredApplied to new messages only
Backup conflictTimer setting from latest backup wins

Recovery Limitations

Recovery Behavior: 1. User loses device 2. Restores from backup 3. Recovery includes: - Non-disappearing messages: Restored - Disappearing message content: Not restored - Conversation exists: Yes - Timer settings: Restored - Message history gap: Visible 4. Recipient's perspective: - Their copy also expired - No authoritative record exists - Message effectively erased

Limitations and Caveats

While disappearing messages provide enhanced privacy, users should understand their limitations.

Security Limitations

LimitationDescriptionMitigation
ScreenshotsRecipients can capture screenScreenshot detection (partial)
Photos of screenCannot prevent external cameraUser education
Copy/pasteText can be copied before deletionUI restrictions (partial)
Memory forensicsRAM may contain tracesMemory zeroing on delete
Storage forensicsDeleted data may be recoverableSecure overwrite
Backup leakageExternal backup toolsExclude message files
Malicious clientsModified app ignores timersCannot fully prevent

Screenshot Considerations

Screenshot Handling: Detection (where available): - iOS: UIApplicationUserDidTakeScreenshotNotification - Android: FileObserver on screenshot directory - Desktop: Limited detection capability - Web: No reliable detection Response options: 1. Notify sender of screenshot 2. Display warning to recipient 3. No prevention possible User should understand: - Screenshots cannot be prevented - Notifications are best-effort - Privacy depends on recipient trust

Cannot Prevent Recipient Saving

Save MethodPrevention PossibleDetection Possible
ScreenshotNoPartial
Screen recordingNoPartial (iOS/Android)
External photoNoNo
Copy textPartial (disable)No
Forward messageYes (can disable)N/A
Export chatYes (respect timer)N/A

Forensic Security Assessment

Forensic Recovery Difficulty: High Difficulty (secure): - Encrypted message content - Overwritten file content - Zeroed memory buffers Medium Difficulty: - File system metadata - Database transaction logs - OS-level caches Low Difficulty (vulnerable): - Unencrypted backups - Screenshots in photo library - Notification content logs - Third-party keyboard logs Assessment: Disappearing messages provide privacy against: - Casual inspection - Relationship partners - Stolen device (if locked) Disappearing messages do NOT provide protection against: - Determined forensic analysis - Nation-state adversaries - Recipient with intent to save - Malicious app modifications

Trust Model

Trust AssumptionReality
Recipient will not saveCannot be enforced
App is unmodifiedUser could use modified client
Device is secureMay be compromised
OS respects deletionMay have hidden caches
Network is secureMessages already E2EE

Implementation Recommendations

Timer Selection Guidelines

Communication TypeRecommended Timer
Sensitive credentials1 hour or less
Personal discussions24 hours
Work conversations7 days
General privacy30 days
Legal/complianceConsult requirements

User Education Points

TopicKey Message
False sense of securityDisappearing is not forensically secure
Recipient trustFeature requires trusting recipient
Backup implicationsMessages will not be recoverable
Multi-device syncAll devices delete together
Group chatsAll members see timer setting
Last updated on