Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9174507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:46:01+00:00 2026-06-17T16:46:01+00:00

I need to secure my data in Documents Directory so I have used Apple

  • 0

I need to secure my data in Documents Directory so I have used Apple Data Protection API. Apple Asset

  1. I enabled Data Protection in Settings App. Settings->General->Passcode Lock On

  2. I Write the file using the NSDataProtectionKey

     [data writeToFile:imagePath options:NSDataWritingFileProtectionComplete error:nil];
    
  3. File is written successfully

  4. I get the file attributes

      [[NSFileManager defaultManager] attributesOfItemAtPath:fullPath
                                                          error:NULL];
    
  5. It returns this the attributes like this as you can see the NSFileProtectionKey is NSFileProtectionComplete

     NSFileCreationDate = "2013-01-22 06:10:48 +0000";
     NSFileExtensionHidden = 0;
     NSFileGroupOwnerAccountID = 501;
     NSFileGroupOwnerAccountName = mobile;
     NSFileModificationDate = "2013-01-22 06:10:48 +0000";
     NSFileOwnerAccountID = 501;
     NSFileOwnerAccountName = mobile;
     NSFilePosixPermissions = 420;
     NSFileProtectionKey = NSFileProtectionComplete;
     NSFileReferenceCount = 1;
     NSFileSize = 8964;
     NSFileSystemFileNumber = 335997;
     NSFileSystemNumber = 16777218;
     NSFileType = NSFileTypeRegular;
    

I am sure that I have written the file successfully and I read that file successfully. But when I open this device in iExplorer(A external iOS device reader app for mac) it shows me the file written without encrypted.

Without encrypted means I write a image file, but I am able to view that image (in documents Directory) in iExplorer, but my purpose is to encrypt that, because I don’t want users to see those files. I am aware other encryption AES Algorithms, but want to know why Data Protection API didn’t work.

Note: I Use iPad2 iOS 6.0.1 and
Logs recorded in device

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:46:01+00:00Added an answer on June 17, 2026 at 4:46 pm

    But want to know why Data Protection API didn’t work.

    It did work, you just expected more than what it does.

    The encryption iOS applies to the files is transparent to anything in the userland. The encryption is done at hardware level, so that nobody who steals the Flash memory of the device can access the data. However, if the screen is unlocked and the device is turned on, the OS handles these files just like every other file, and they don’t appear to be “encrypted” from within the filesystem.

    If you want to do this, you have to encode the file using some asymmetric encryption method, such as AES (OpenSSL or GnuTLS would do the job well).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that's gathering registration data (username/password, etc). I need to gather
I need to connect to a secure API which requires a certificate be attached
We have a web app, which is written in Java, and storing data into
I need to build a quicken like application, where data needs to be secure.
I have a query regarding sending secure data over the network in iPhone. What
I have a small amount of structured data and I need to accomplish three
I have a tomcat-hibernate-hsqldb setup and I want to use SSL to secure data
I need to implement secure data transfer from client to server (binary data). I'm
I need to implement Gutmann 's algorithm for secure erasing some data in a
I need to secure my website without using the ASP.NET built in login controls

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.