1

I want to create a password protected TXT file from my app. I don't mind if it'll be a protected folder with the file in it or some kind of protected archive. My goal is to make a file which can only be viewed by those who know a certain password. How is it done in Cocoa?

Yashman
  • 111
  • 1
  • 11

1 Answers1

1

Rather than "password-protect" a text file (easily bypassed if the file system can be read by something that doesn't give a **** about your access control), why not write the text file as encrypted data to disk? Here's one example Q&A for AES encryption and a link to an NSData category that makes it easy to use.

Community
  • 1
  • 1
Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135