How to Encrypt a Text File

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.

When you need to ensure the contents of a text file are secure, use the encryption option available in Windows 7 and Windows 8.1. Encryption makes the file inaccessible without the encryption key.

Step 1

Locate the text file in File Explorer. You can encrypt the text file directly or put it in a new folder and then encrypt the folder. Right-click the file, select Properties and click the Advanced button. Select Encrypt Contents to Secure Data. Note that you can also compress the contents to save disk space. Click OK.

Advertisement

Video of the Day

Click the Encrypt Contents to Secure Data check box.
Image Credit: Screenshot courtesy of Microsoft..

Step 2

Click the Encrypt the File Only option to encrypt the text file. Select the Encrypt the File and Its Parent Folder only if you have placed the text file in a separate folder. Encrypting a Parent Folder encrypts everything in that folder.

Advertisement

Select Encrypt the File and Its Parent Folder.
Image Credit: Screenshot courtesy of Microsoft..

Step 3

Move the file to any drive that supports encryption using the NTFS file format. Encrypted file names appear green in File Explorer.

Advertisement

Encrypted files are displayed with green text.
Image Credit: Screenshot courtesy of Microsoft..

If you want to put an encrypted file into a FAT32 formatted USB drive, you need to reformat the drive to NTFS first.

Advertisement

Advertisement

Backing Up the Encryption Key

Because encrypted files require the encryption key created by Windows, you could lose access to the file if your computer crashes. After creating an encrypted file, back up the encryption key to a backup drive.

Video of the Day

Advertisement

Step 1

Click the Encrypting File System icon that appears in the Windows Taskbar immediately after creating your first encrypted file. If it doesn't appear there, click the Expand arrow to find it.

Click the Encrypting File System icon.
Image Credit: Screenshot courtesy of Microsoft.

Alternatively, type "encryption" in Windows Search and select Manage File System Certificates.

Advertisement

Step 2

Click Next when the Encrypting File System window opens. Click Next again.

Advertisement

Image Credit: Screenshot courtesy of Microsoft.

Step 3

Select a backup location drive and folder, then enter a secure password in both Password fields. Click Next once again.

Advertisement

Use a strong password to back up an encryption key.
Image Credit: Screenshot courtesy of Microsoft.

Step 4

Click the I'll Update My Encrypted Files Later if this is the first time you've encrypted a file. If you have encrypted files in the past, select All Logical Drives to update all of your encrypted files to use this one key. Click Next again to finish the backup process.

Advertisement

Select I'll Update My Encrypted Files Later.
Image Credit: Screenshot courtesy of Microsoft.

Sharing Encrypted Files

To access an encrypted file on two different computers, such as a computer at work and at home, you need to export the encryption key to the other computer.

Advertisement

Advertisement

  1. Type "certmgr.msc" in Windows Search and click the Certmgr.msc icon.
  2. Expand the Personal folder by clicking its Arrow and then select the key you made.
  3. Click the Action menu, select All Tasks and click Export to launch the Certificate Export Wizard.
  4. Launch Certmgr on the other computer, open the Personal folder and select Import from the Action menu's All Tasks option. The Certificate Import wizard opens.

Advertisement

Click the Action Menu and select All Tasks to export an encryption key.
Image Credit: Screenshot courtesy of Microsoft.

To share an encrypted file with another person, such as via a USB drive, the other person must first export his encryption key using Certmgr and give it to you. You then need to import that key using your computer's Certmgr. Then:

  1. Right-click the file you are going to share and select Properties.
  2. Click the General tab, select Advanced and then Details.
  3. Click Add, and then click the certificate in the Select User dialog box. Click OK.

Advertisement

Advertisement

references