Draft · Pending review · Not in force
/ Legal

Technical · Security

Security and Data

Version
0.11
Last updated
Effective
Not yet in force
Status
Draft
Version history

1Architecture#

1.1 DreamGate is local-first. All data lives in one SQLite database on your phone, and all processing (sorting, speech to text, the rest check, sun times) happens on the phone.

1.2 There is no DreamGate account, no sign-in and no server. The app contains no analytics, advertising, tracking or crash-reporting libraries, and no code that loads anything from the internet.

2The database on your phone#

Table 1 · Database encryption
ItemDetail
EngineSQLite with SQLCipher (through expo-sqlite), which encrypts every page of the database file
Key256 bits from the platform's cryptographically secure random generator, created on first launch
Key storageiOS Keychain with "after first unlock, this device only" protection; on Android, expo-secure-store, which encrypts the key with a key held in the Android Keystore
Key locationThis phone only. On iPhone the Keychain item is excluded from iCloud Keychain and doesn't migrate to another device; the app never exports it
If the key is missing or wrongThe app stops with "Your journal on this device can't be unlocked". It never creates a new empty journal over the old one

3Encrypted backups#

3.1 Backups are encrypted-only. The readable journal exists only in memory while the backup is built, and the only file written is ciphertext. Older unencrypted backups can still be restored, but none can be created.

Table 2 · Backup encryption
StepDetail
PassphraseAt least 12 characters, entered twice, normalised (Unicode NFKC) so the same passphrase works on every device. Never stored
Key derivationscrypt (RFC 7914) with N = 2^17, r = 8, p = 1, the minimum OWASP currently recommends, and a fresh 16-byte random salt per backup. Phones use native OpenSSL (through react-native-quick-crypto); the web preview uses @noble/hashes
Self-checkBefore first use, the platform's scrypt must reproduce the RFC 7914 test vector, or the app refuses to encrypt or decrypt anything
EncryptionAES-256-GCM with a fresh 12-byte random IV; the file header (format, version and parameters) is authenticated as additional data, so it can't be altered without detection
FileJSON: format, version, the scrypt parameters and salt, the cipher name and IV, and the ciphertext with its authentication tag
On restoreThe app decrypts and fully validates the backup before changing anything. A wrong passphrase changes nothing. Imported scrypt parameters are bounded (N up to 2^17) so a crafted file can't stall the phone

3.2 Your passphrase is the only way in. We can't recover or reset it. Choose one you'll remember, or store it in a password manager.

3.3 What a backup contains. Everything in the database except your saved location, which stays on the phone (see the App Privacy Policy, Table 1).

4Network#

4.1 Android. Release builds don't request the INTERNET permission, so the operating system doesn't allow the app to open network connections at all.

4.2 iOS. iOS has no internet permission to remove. Release builds turn on App Transport Security fully (no arbitrary loads and no local-network exceptions), and the app contains no code that makes network requests.

4.3 Speech recognition runs in the platform's on-device mode only (section 6).

5Permissions#

Table 3 · Permissions in release builds
PermissionPlatformUsed for
Microphone (RECORD_AUDIO) and speech recognitioniOS, AndroidVoice capture, only while you hold to speak
Approximate location (ACCESS_COARSE_LOCATION; iOS "when in use", reduced accuracy)iOS, AndroidSunrise and sunset for the sun-based theme, only if you choose it
Modify audio settingsAndroidAudio playback routing
VibrateAndroidHaptic feedback
Health: sleep, read only (HealthKit on iOS; Health Connect READ_SLEEP on Android)iOS, AndroidSleep history, only if the user turns it on. No write access, no background delivery

Blocked or never requested: internet (Android release), precise location, storage read/write, drawing over other apps, contacts, calendar, photos, camera, motion, any health data other than reading sleep, writing to Health, background health delivery, Face ID, background location and tracking (iOS App Tracking Transparency).

6Speech to text#

6.1 The app calls the platform recogniser with on-device recognition required, and with audio recording persistence turned off.

6.2 Before offering voice, the app checks that on-device recognition is available for your language. On Android it checks the on-device service's installed languages. If the check fails, voice stays off with a reason, and there is no cloud fallback.

6.3 The app asks for final results only, with no interim text, and holds them in memory, never in screen state or storage. When you finish, the whole text goes once to the sorter and is stored only as cards, and filing, dropping or deleting a card erases it with SQLite's secure delete and a checked checkpoint.

7Device backups and moving phones#

7.1 Android: the app sets allowBackup to false, so Android's automatic cloud backup and device-to-device transfer don't copy its data.

7.2 iPhone: iCloud and computer backups can include the database file, which stays encrypted. Its key is "this device only", so a backup restored to a different phone can't unlock it.

7.3 To move to a new phone, export an encrypted backup and restore it there.

8Deleting data#

8.1 Delete all data (Settings › Your data) erases every entry, task, record, setting and the saved location, after a confirmation.

8.2 Deleting an entry (from its screen, after an Undo) erases its words, themes and saved notes with SQLite's secure deletion on, in one transaction, and then empties the write-ahead log, so no trace is left in the App's database files or in new backups. A test checks this.

8.3 Delete all data also removes backup files the app left in its own temporary storage, and replaces the database and its encryption key with new ones, so erased data can't be recovered from the phone's storage.

8.4 Deleting the app removes its database file from the phone.

9iOS privacy manifest and app store labels#

9.1 The iOS build includes a privacy manifest that declares no tracking, no tracking domains and no collected data types, and lists the "required reason" system APIs the app's libraries use.

9.2 The app store privacy labels are "Data Not Collected" (Apple) and "No data collected or shared" (Google Play) [TO CONFIRM: answer the store questionnaires before submission and keep these in line].

10The web preview#

A private, unlisted browser preview of the app exists for testing (not linked from this website). It has no on-device speech recognition, and it encrypts its stored data with a non-extractable key held by the browser, which is weaker than a phone's hardware-backed keystore. This page describes the phone apps [TO CONFIRM: describe the web preview here only if it becomes public].

11Reporting a security problem#

If you think you've found a security issue in DreamGate, email security@dreamgate.one. The same contact is published in /.well-known/security.txt. Please give us a reasonable time to fix it before making it public.

12Version history#

Table 4 · Versions of this page
VersionDateWhat changed
0.12026-10-12First draft. Not in force.
0.22026-10-12Security contact is security@dreamgate.one. Not in force.
0.32026-10-12Adds the read-only sleep permission for Sleep history; health data other than sleep stays never-requested. Not in force.
0.42026-10-12The foreground media-playback permission is no longer requested; night sound isn't part of the app. Not in force.
0.52026-10-12Section 8.1: Delete all data is under Settings › Your data (D-146). Not in force.
0.62026-10-12Calendar access added to the never-requested list; the App only opens the add-event screen (D-148). Not in force.
0.72026-10-12New 8.2: deleting a single entry (D-149); the rest renumbered. Not in force.
0.82026-10-136.3: final results only, held in memory, checked on the phone before anything is written; cards erased with secure delete (D-160, D-161). Not in force; lawyer review recommended (D-162).
0.92026-10-136.3: the on-device check is removed; the whole text goes once to the sorter and is stored only as cards (D-180). Not in force; lawyer review recommended (D-162).
0.102026-10-14The open question in section 11 is addressed to the user or control, with lawyer review recommended (D-181). Not in force; lawyer review recommended (D-162).
0.112026-10-14Section 11: the safe-harbour sentence is removed. Not in force; lawyer review recommended.