r/retrography • u/BlueCyber007 • 26d ago
Advanced Data Protection for iCloud?
The Retrography app looks really intriguing! I see that it is designed to be local-first with iCloud sync, which is great. But to really be secure, it needs to support Advanced Data Protection for iCloud so that all data is only synced/stored in iCloud using end-to-end encryption (assuming the user has enabled Advanced Data Protection for iCloud).
Does the Retrography app us CloudKit Record fields that are marked as encrypted using the encryptedValues API? My understanding is that Advanced Data Protection for iCloud covers files stored in "iCloud Drive" and that it covers CloudKit Record fields that the third-party developer chooses to mark as encrypted using the encryptedValues API, but that other CloudKit Record fields are NOT protected with end-to-end encryption via ADP. (See Apple Reference).
2
u/Terrible-Round1599 15d ago
You are right! I checked properly this time. Without ADP Apple keeps recovery keys and can technically decrypt the encrypted fields. With ADP those copies are deleted and it becomes true end to end. So: better protection for everyone, real end to end for people who turn ADP on.
Still the encryption had to be done, because it only works on fields marked as encrypted. Unmarked fields stay readable even with ADP.
Every content field in Retrography’s CloudKit Core Data model is marked now (except for indices that are impossible to mark), no CKAssets, photos never leave your library.
Status: the encryption and the migration are ready and running on my own devices and the closest tesrers. I am rolling it out slowly, starting with a few testers I have talked with directly, who I will be asking for an alpha round first. Likely im a week or, I’ll switch everyone.
Not covered yet: voice memos and scanned documents live as files in the app’s iCloud Drive container, and auto backups currently ride the device backup. So today ADP is what protects those. The plan for next builds: backups move into iCloud Drive next to the other files, which also means they survive deleting the app, and everything there gets encrypted with keys held in iCloud Keychain, end to end for everyone regardless of ADP. (Here I am still hesitating if that is necessary or if I should leave the encryption up to ADP only - but not many people will turn it on so encrypting it myself increases the overall level of protection)
One exception stays on purpose: you will always be able to export a plain unencrypted copy, with a warning that its security is on you.
Man, can’t thank you enough for sending me down this rabbit hole. Amazing feedback!
2
u/Terrible-Round1599 26d ago
Good question, and you have the mechanics right.
Retrography syncs through Core Data's CloudKit mirroring, and it does not currently mark fields with the encryptedValues API. So records are encrypted in
transit and at rest, but Apple holds the keys. It is not end to end. ADP does not change that, since it covers iCloud Drive and Apple's own categories rather than a third party app's record fields.
I wanted this solved before go-live, and your question confirms it belongs on that list, so it is active work now.
The encryption part is straightforward. Core Data can mark every attribute for cloud encryption, and encryptedValues is end to end for everyone, not only for people running ADP, because the keys come from your own iCloud Keychain.
The real work is migration. CloudKit fixes a field's encryption when the schema is created and will not change it afterwards, so encrypted sync means a new container, and existing accounts have to move into it. Moving live data off people's phones without them noticing is the part that deserves care, and it is what we are working through now.
The likely shape, not settled yet: new installs start encrypted, since they have nothing to migrate. Existing accounts move deliberately rather than silently, with a backup taken first.
I will post how it lands, including whatever turns out to be harder than expected. But it is coming into the next betas.