How to encrypt your files with 7-Zip and WinRAR

winrar-7zipIf you need to share compressed files by email, or upload them to the private cloud, you can use the 7-Zip tool itself to compress and encrypt all the files and folders we have inside. Thanks to this functionality, we can send a file safely from a source to a destination, as the decryption key will be required to access the content. Today we are going to show you how to easily protect files compressed with 7-Zip.

Encrypt files with the 7-Zip program

The 7-Zip program is one of the most complete and used by many users. To compress a file and encrypt it, we just have to follow the following steps:

  1. Have the 7-Zip program installed.
  2. We must select with the right button the folder that we want to compress and protect.
  3. Then we select the context menu called 7-Zip.
  4. Here we can select “add to” or “compress and send by mail”. You can select the option that suits you best.
  5. On the screen that comes out we must first select the format of the file we want, that is, to what extent we want to compress it.
  6. Then in the encryption section we must write the encryption password we want.
  7. To finish we must select accept.
  8. If we have selected the option to send by email, the email manager we use will automatically open.



As you can see in the previous capture, we can select different encryption methods, the most used is AES-256, so simply by selecting this option and entering the corresponding password, we can encrypt all compressed files. The derivation function used is based on PBKDF2 using HMAC-SHA256.

Encrypt files with the WinRAR program

The WinRAR program is also one of the most used to compress files in .rar. This program will also allow us to encrypt the contents of files and folders that we compress. In order to do so, we must follow these steps:

  1. Have the WinRAR program installed
  2. We must select with the right button the folder that we want to compress and protect.
  3. Then we select the WinRAR icon the option that says “add to file” or “add and send by email”. You can select the option that suits you best.
  4. On the screen that comes out we must select the option that tells us to set password.
  5. Then a new window will open where we must enter the password we want, and we must also confirm that password.
  6. To finish we must click on accept and again on accept.
  7. If we have selected the option to send by email, the email manager we use will automatically open.

RAR files are encoded with AES -256-CBC for RAR 5.0 format files, and with AES-128-CBC and with AES -128-CBC for RAR 4.X files. The bypass function used in RAR 5.X is based on PBKDF2 using HMAC-SHA256. By default, ZIP files use AES -256-CTR encryption.

As you can see it is very easy to compress a file and encrypt it using the 7-Zip and WinRAR programs, two of the most used programs to compress files. The encryption that both tools use is currently considered safe, however, we must be continuously compressing and decompressing the content to access it. If you do not need to compress it, you will always be able to create encrypted containers using the VeraCrypt tool among others.