I have an iMessage application that send files. Data is saved in iCloud servers using CloudKit. Everything works well.
Now I want to add a new level of security. I want to encrypt the data before sending it to iCloud.
The problem is that using public/private key pairs is not possible:
- In iMessage the extension can't identify users.
- No real time session can be opened between conversation participants to exchange keys.
None of the options below are strong enough to make the data secure:
- Use a key encryption hardcoded in the application.
- Generate a random key, encrypt data with it and save it with the data in the iCloud servers, so it can be downloaded with the file to decrypt it.
iCloud may be secure but users' data could be personal/sensitive so I want to add a new security layer + it's a fun exercice for me.
Could anyone help to find the right encryption method?