Sponsors

Apple Store

Visit the official Apple Store to buy a Mac online. Free shipping!



Editors' Picks


Comments

Contact Us

Search

Top Posts

Categories

Recent Posts

Our Feeds


Ask OS X Daily: “How can I password protect a file?”

Hello all you loyal OS X Daily readers! Recently we have been receiving a large number of Mac OS X related questions in our inbox. Normally our staff would try and respond with an answer to the best of our knowledge. However, sometimes we get a question we absolutely do not know the answer to. We think it would be fun to run some of these by the many regulars who stop by the site. Please help us with the following question, and feel free to continue to email us with any Mac OS X related questions.


Greg Simon writes:

“First off, I’ve enjoyed the numerous tips and tricks posted by the knowledgeable folks at OS X Daily. I have something I think you guys might be able to help me with. Recently I found myself writing a journal, and as such I really want to find a way to password protect it so my inner thoughts don’t end up in the hands of the wrong person. Multiple people use my laptop and its not a good feeling knowing that anyone could just double click my text file of emotion and find out everything about me! All I’m looking for is a way to encrypt a file on a file-by-file basis, do you guys have any suggestions?”

Digg!


Social bookmarks:


Comments:

Comments: 12

Comment from Frank Müller
Time: March 7, 2007, 2:15 am

Hi there,
you could write in Vim and encrypt the file via the :X command. Plain and simple.

Comment from David
Time: March 7, 2007, 3:15 am

OS X does have some encryption stuff in disk images..

Thats not exactly on a file-by-file basis, but still - you could create a disk image at a certain size encrypt and password protect it and keep all your “secret” stuff there, and you wouldn’t have to look for 3rd party software to do the job ..

Comment from Neil
Time: March 7, 2007, 5:38 am

I have been using a dashboard widget “DashCrypt” to do this task. For most things it works well……

http://www.dashboardwidgets.com/showcase/details.php?wid=588

Comment from niclet
Time: March 7, 2007, 6:36 am

Encrypted Disk Image is the best “native” way. Besides, I personally use Crypt (http://www.dekorte.com/projects/shareware/Crypt/) simple and tough.

Comment from niclet
Time: March 7, 2007, 6:38 am

Sorry, here’s the “live” link:
http://www.dekorte.com/projects/shareware/Crypt/

Comment from Dimitri
Time: March 7, 2007, 12:57 pm

As others have already suggested, I use an Encrypted Disk Image. It may not be exactly what you were looking for; however, it may be easier to have a single “my disk” which is encrypted.

Comment from Vladimir
Time: March 7, 2007, 3:58 pm

great q

Comment from Christopher
Time: March 7, 2007, 6:35 pm

I too have looked for a way to do this, but have not been able to find one. There really is no straight forward way to do this in OS X. I did find at one point, a third party app that let you set a password then would hide and unhide the files you told it too when you opened it and entered the password, but the program was poorly designed and did not function well. So here are a few simpler options.

If your journal is typed in Microsoft Word of NeoOffice Writer, then you can save the document with a password. In Word click Options… in the save dialogue then enter a password there. In Writer, click Save As… then click the “Save with Password” checkbox. I do not know if that helps at all.

Also, if you are not using a word file, or even if you are but wanted further protection, then you could change the file permissions either in “Get info” or from the terminal, so that it the file could only be read when you are signed in under your own username, or with root privileges. To do this, you would open the “Get Info Dialogue,” scroll down to Permissions, then change everything but “Owner” to “No Access.” You may need to enter your password at some point. However, this would only help if all the users of your laptop use different usernames and passwords.

Finally, this will not password protect your file, but you could hide the file from prying eyes by opening the terminal, navigating to the directory in which your journal is stored, and renaming the file with a “.” before it. The command to rename is mv. For example:

mv MyJournal.txt .MyJournal.txt

would do the trick, obviously replacing “MyJournal.txt” with the name of your file. Then, just issue the reverse command to get it back when you would like to edit it:

mv .MyJournal.txt MyJournal.txt

You can also combine any or all of these three tricks for added security. Bear in mind that none of these methods actually encrypt your data, they just lock people out of it or hide it. For encryption, your best bet is the encrypted disk image mentioned above.

Comment from Christopher
Time: March 7, 2007, 6:36 pm

Sorry. typo in the last post, poor proofreading. “Microsoft Word of NeoOffice” should read “Microsoft Word OR NeoOffice”

Comment from Jim
Time: March 21, 2007, 12:32 pm

Just use OpenSSL like shown here: http://snippets.dzone.com/posts/show/341

Comment from Andy
Time: February 3, 2008, 3:00 am

Now here is an idea that i am just trying. Launch keychain access (in the utilities folder) Go to the File menu and then New Keychain name it give it a password (not your login password) and then right click on it when it shows up in the side bar click on Change Settings and make sure it is set to automatically lock. Now you can add a new secure note item and others cannot access it without your password.

Comment from Jake
Time: March 3, 2008, 6:17 pm

Here is a widget that actually hides files and folders from both spotlight and finder. Just drag said file into the magic hat, add a password, and you are done. See this site for more details: http://www.dashboardwidgets.com/showcase/details.php?wid=1410

Write a comment





March 7th, 2007