Threat model: export and import
exportAll writes this device’s records to a file the user keeps, and importAll reads one back. They exist so the
user controls their data, not only holds the keys to it: if the app goes away, the server’s copy can’t be read.
9.1 What they enforce
Section titled “9.1 What they enforce”- Content, never keys. An export holds record values, the blobs they refer to, and each collection’s id, name,
schemaVersionand count. Local-only fields, sync state and every key stay out: the AEK, the Secret Key, wrapped keys, record DEKs, and the identity in the keyring. Neither kind of file is a way into the account. A blob’s DEK goes in only as part of its reference in a value: it opens that blob’s copy on the server, whose bytes are in the file. - A sealed backup opens only with its passcode. A random key seals it, wrapped under the passcode with PBKDF2 at
600,000 iterations (
wrapKey). Each 1 MiB chunk is AES-GCM with an AAD naming the backup, the chunk’s place and whether it’s the last, so a chunk that was changed, dropped, moved, repeated, taken from another backup, or a file cut short at a chunk’s end, fails to open. - Nothing written from a file that doesn’t check out. Import reads the whole file before it writes: for a backup, every chunk; then the ZIP’s checksums, every record, each collection’s count against the manifest, and every blob’s size against its reference.
- Import keeps what this device holds. A record this device holds with another value is kept unless the app asks
for
replace.
9.2 What they rely on
Section titled “9.2 What they rely on”- Where the file goes. A plain export is unencrypted plaintext, wherever the browser saves it: a downloads folder, a synced drive, an email. The app says so where the user saves it.
- The passcode. A backup in cloud storage is open to offline guessing, slowed only by PBKDF2. The passcode rules are the app’s.
- A sync before the import. What import adds is a pending change, and the next sync merges it with the server’s
copy by the collection’s policy. Under
lastWriteWinsthe import’s value wins, so an old file imported on a device that hasn’t pulled can replace a newer value from another device. After a sync the device holds the server’s records, and import keeps them. - The file is the user’s own. A plain export carries no signature, so anyone who can change it can change what an
import adds: import trusts its contents as the user’s, as it would trust the user typing them in.
replacewidens that to records the device holds.