Search code examples
iosswiftdownloadnsdocumentdirectory

How safe is to store files into the document directory?


I am writing an iOS app in Swift and Xcode where I allow users to download some files from a server and to store them into the iPhone's document directory.

How safe is it to do so?

Is it possible for a user to access one of these files from outside the app, for example by connecting their phone to a computer, and move them around or share them? If a user has a jailbroken iPhone, could he get a way to access the downloaded files in other ways other than the one I allow within my app?

And if so, should I encrypt my files when I download them?


Solution

  • For jailbroken iPhone i think yes it's possible to access apps directories.

    For normal iPhone I'm pretty sure other apps can't access it as all third-party apps are “sandboxed"

    https://support.apple.com/en-gb/guide/security/sec15bfe098e/web#:~:text=Sandboxing,information%20stored%20by%20other%20apps.

    And no idea about connecting their phone to a computer.