Neither Windows nor Mac OS X natively supports adding passwords to folders. However, there are several methods to safeguard your files. Follow the steps outlined below.
Steps
Windows XP

Create a compressed folder. Right-click on the desktop or any location where you want the folder. Select New, then click on Compressed (zipped) Folder. This will generate a new zip file where you can add files just like a regular folder.

Move files. and paste or click and drag your files into the new zip file. You can move as many files and folders as you like.

Add a password. Open the zip file. Click on File, then select Add a Password. Enter your chosen password and confirm it by typing it again. You will now need this password every time you access the zip file.
- Other users can still see the contents of the folders but cannot open them without the password.

Delete the original. Once the zip file is created, you will have two copies of the folder: the original and the zip file. Delete or move the original to prevent others from viewing it.
Windows Vista and Newer Operating Systems

Download and install third-party compression software. 7-Zip is one of the most popular free tools available. This guide will be based on using 7-Zip.

Create a compressed file. Select the folder you want to password-protect. Right-click and choose 7-Zip from the menu. From the secondary menu, select “Add to archive…” This will open 7-Zip.

Adjust the settings. You can rename the file to be created. Select .zip from the “Archive format” menu if you want the folder to be compatible with systems that do not have 7-Zip installed.

Add a password. On the right side of the 7-Zip window, there are two fields to enter and confirm the password for the file. You can also choose your encryption method or encrypt file names. Click OK when you’re done.

Delete the original file. Creating a compressed file will result in two copies of the data: the original file and the compressed file. Delete or move the original file to prevent anyone from accessing it.
Mac OS X

Create an encrypted disk image. To password-protect files and folders on Mac OS X, you need to create an encrypted disk image that you must mount whenever you want to access the files. Choose the size of the image, which will match the total size of the files it contains.

Open Disk Utility. You can find it in the Utilities folder within Applications. Once the program is running, click on File, then select New. Choose Blank Disk Image. A new window will appear; select Sparse Disk Image from the Image Format menu.

Select the size. You can choose from a list of predefined sizes or enter a custom size. Pick a size larger than the total size of the files you’re adding, so you can include more files later if needed.

Choose the encryption method. You can select either 128-bit or 256-bit encryption. AES 128-bit encryption is highly secure and sufficient for most users. Using 256-bit encryption may take significantly more time.
Name the disk image.

Fill the disk image. Once the disk image is created, both the file and the mounted image will appear. Add files to the mounted image, then drag it to the trash to unmount it. When you need to access the files again, open the disk image file. You’ll be prompted to enter the password, and the disk image will remount.
Warning
- Remember your password. If you lose it and the files are not backed up, you may permanently lose access to them.
