Previous 1 2 Next 16 Replies Latest reply: Sep 17, 2012 9:09 PM by LC
Souad H Level 1 (95 points)

Either using the apps that are included or any FREE app thanks

MacBook Pro, Mac OS X (10.7)
  • thomas_r. Level 7 (30,749 points)

    You can create an encrypted .zip file with the following command in the Terminal:


    zip -e /path/to/ /path/to/original/file/or/folder


    Of course, you'd want to replace those paths with something more appropriate.

  • Souad H Level 1 (95 points)

    Thomas A Reed wrote:


    zip -e /path/to/ /path/to/original/file/or/folder


    Of course, you'd want to replace those paths with something more appropriate.

    Can you like give me more details I can't understand what stuff I should change to the real thing and what stuff should I keep.

    So let's say

    file name:

    location: Desktop

    Drive: Macintosh HD

    Users: home


    I hope you can just give me the exact path for the  information above so it can work thanks again.

  • thomas_r. Level 7 (30,749 points)

    Well, first, there are a couple caveats.  If you want to compress your home folder into an encrypted .zip file, you wouldn't want to place that .zip file on the desktop.  There could be problems with trying to put the .zip file inside the folder you are zipping!  I would put it at the root level of the hard drive instead.  Second, if this is something you want to do regularly, as a means for creating an encrypted backup of the home folder or something similar, this isn't a very efficient or easy method.  Creating such a large .zip file will take a long time, and it will have to be re-created from scratch every time you want to update the backup.  It would be better to use a specific tool for that task.


    However, all that said, to create a zip archive named at the root level of the hard drive, containing the entire home folder, you would execute the following command:


    zip -e / /Users/yourusername


    You should also be able to substitute '~' for your home folder path:


    zip -e / ~


    If you wanted to create an archive of your Documents folder and place it on the desktop, to give another example, here's the command you would use:


    zip -e ~/Desktop/ ~/Documents


    Hope all that helps!

  • Király Level 6 (9,745 points)

    Just a caveat: The encryption method used by zip is weak; the man page for zip itself says so.


    Much more secure is to make an encrypted sparse bundle disk image with Disk Utility. You can add/remove files from it whenever you want. The drawback is that it will work with Macs only - no Windows.

  • Alberto Ravasio Level 4 (3,902 points)
  • Limnos Level 8 (47,396 points)

    One tip to using Terminal.  You can drag files and folders to it and they will be entered automatically.  This saves a lot of long typing and tricky coding where you have names with spaces that Terminal would normally interpret as parts of command sequences.  So, if I want to copy File1 to Folder2 I could type:




    put a space after it.


    Drag File1 to Terminal.  It will automatically put a space after it, then drag folder2 to Terminal. I end up with


    cp[space][File to copy with full path][space][Destination folder with full path]


    Hit return to execute the command.

  • Limnos Level 8 (47,396 points)

    Alberto Ravasio wrote:


    Keka is a free file archiver for Mac OS X

    Does it do encryption?

  • Alberto Ravasio Level 4 (3,902 points)
  • Souad H Level 1 (95 points)

    okay um I don't know why you guys are telling me to encrypt.

    I have a video and I only want a way to add a password to it. So like if I open the video (zipped or not) it'll ask for a password.

    Now if I encrypt something does that mean adding a password to a file?

  • Topher Kessler Level 6 (9,865 points)

    If you don't need to use the .zip format specifically, you can create a compressed encrypted disk image with Disk Utility, and then use that as a secure medium for transferring or storing your files. This option will interface better with OS X, but will be specific to OS X so will not be the best if you need to use the files with Windows or Linux.

  • g_wolfman Level 4 (1,120 points)

    They're telling you to encrypt because they're assuming that you want to protect the data from unauthorized access.  A password with no prtection is like putting a Do Not Enter sign on an unlocked door; it only keeps out the sort of people who wouldn't enter without asking in the first place.


    Now, if what you want is to keep your technilogically illiterate grandmother from accidently stumbling across your pr0n, then a password is good enough.  Otherwise, you probably want to look at encryption.


    There are applications that will let you do either one, such as Espionage2 (who actually include the Grandma scenario in their sales pitch...but not the pr0n) and Knox.  But they do cost money.  Or, there's the methods referred to by the other posters.  Surprisingly (or not) just plain old password protection without encryption isn't that common; it's actually hard to come by. 


    And finally, unless the password protection is actually provided by the application making the file (as with some Microsoft Office products) you will have to password protect the folder in which you put the file.  You can't just add passwords to random files.

  • thomas_r. Level 7 (30,749 points)

    We are talking about encryption because you asked about adding a password to a zip file, and that means encryption.  Sometimes passwords may be requested that don't involve encryption, but that is not the case with zip files.


    However, now that you mention a little more about what you're trying to achieve, a zip file isn't appropriate at all.  To protect a video, you'd have to create an encrypted zip file with the movie in it, then delete the original movie file.  To watch it again, you'd have to decompress the zip file.  Clunky.


    Who are you trying to protect this video from?  If you just want other users of the computer to not be able to see it, create a different user account for other people and keep yours locked up.  Log out when you're done, and don't give the other users your password.  That's not strong protection - there are ways for a tech-savvy person with physical access to the computer, especially if they have access to an admin account on the computer, to get around that - but it works against casual intrusion.


    If you want something stronger than that, you need encryption.  You'd probably do better to create an encrypted disk image in Disk Utility and then copy the video into that.  I've never done that, though...  it's possible the encryption might cause some playback issues.  Or not.  You'd have to try it and see.

  • LC Level 1 (0 points)

    Hey Guys,


    Thanks for the insight in encrypotolgy , Its seems a bit over my head and my available time.


    Nevertheless I have tried to zip a file in to an encrypted zip file.




    zip -e /  ~/Documents/Folder/File.doc



    The output is, when I try to decompress the file i get.


    Unable to Unarchive "" in to "Machintosh HD".


    (Error 1 - Operation not permitted.)



    the comment in the terminal after command ran is.


    adding: Users/LC/Documents/Folder/File(deflated 40%)


    Any ideas that could help?


    All the best




    Mac OSX 10.6.8

  • LC Level 1 (0 points)



    Snow Leopard - Macbook pro

Previous 1 2 Next