Developers - open source encrypted database solution for self-tracking on phones

Does there exist a consensus on how to store timestamped self-reported data from an application with encryption?
I think it would be good for any one who is curious to build their own self-tracking app, for themselves or for others as a school project or whatever, to know what the standard should be.
Elsewhere I am seeing people tracking self-reported data that should never be stored in non-encrypted fashion.
Can someone help me with this?

I believe Apple HealthKit data is encrypted when the phone is locked. So an app that used HealthKit as a a datastore would have the datastore encrypted; that’s perhapse useful at least an example.

Thanks Gary.

I’m editing my post title. I should have clarified that I am seeking an open source solution. Your response is helpful, I realise that trust is a bit part of any such solution and Apple definitely have that going for them

Why? what could go wrong?