Hi,
I have a function in my app where a customer can choose to encrypt a specific field. All the values for that field across all records will be encrypted.
What I want to know is, what happens to the old non-encrypted values? The way I understand CBL is that it will create a revision with the new updated data (in this case, the newly encrypted values) and keep the old revision around. But then that means there's both an encrypted and unencrypted version of the same values hanging around in the same database file.
What's the proper way to handle this situation?
The newly encrypted values of course may need to be synced to their other devices so there could still be unencrypted versions of the values on their other devices. But that's to be expected. At least on the source device where the values were originally encrypted, it should not be possible to access the previously unencrypted values.
Would compacting the database after the values are encrypted remove the old revisions with the unencrypted data?
Thanks,
Brendan