Field notes / Note 012
A lost key is an error, not a fresh start
2 min
An encrypted database on a phone has a key, and keys get lost. The operating system clears one, a restore goes sideways, an update misbehaves.
The easy code handles this kindly. No key found, so make a new key and a new database. The app opens. Nothing crashes. There is an empty screen where a person’s records were, and an old file nobody can read any more.
So the store throws instead of regenerating, and opening refuses when the database file exists without its key. The app stops and says so.
A crash is a bad morning. A cheerful empty app is a person finding out later.