saoudrizwan / Disk

Delightful framework for iOS to easily persist structs, images, and data
MIT License
3.08k stars 170 forks source link

Security #71

Closed pauleen-villareal-itfaq closed 5 years ago

pauleen-villareal-itfaq commented 5 years ago

How can we secure the data we store using this library?

saoudrizwan commented 5 years ago

Apple encrypts data stored to disk by default. More specifically data is stored with Complete until first user authentication protection, see the docs.

If you're looking for a more custom encryption strategy, I suggest checking out CryptoSwift. If you have a backend, you could generate a token for the user logged into your iOS client, and use this token to encrypt/decrypt data stored to disk.

kylebrowning commented 5 years ago

@saoudrizwan That makes sense but what if we would like to change this. Some files may need to be accessed while the app is in background mode (and thus encrypted files are unavailable).

This currently isn't exposed via your API.