It is recommended that you store confidential data in an encrypted location to prevent unauthorized access. This becomes more important when you share your computer with others. Encryption encrypts information in such a way that it cannot be read by anyone. Therefore, it does not allow other users to access your data and see what is inside. It can be decrypted only to those who have a key that converts the information back to its original and readable form. Encryption is important not only for data transfer, but also for data storage. Without encryption, anyone who has access to your system can view and modify your data.
Under Linux, there are several ways to add encryption. VeraCrypt is an open source encryption tool for files, folders, and entire partitions, available not only for Linux, but also for Windows and Mac OS. In this article I will describe how you can encrypt a partition under Linux using VeraCrypt.
We have completed the commands and procedures mentioned in this article on the Debian 10 operating system.
VeraCrypt can be downloaded from the VeraCrypt website. Go to downloads VeraCrypt official website page and download the installation file specified for Linux.
Install VeraCrypt on Debian
To install VeraCrypt, open the file manager. Switch to Downloads folder under House catalog. Right-click on the downloaded VeraCrypt installation and select Fetch here option.
Now run the Terminal application of your system. To do this, go to activity tab in the upper left corner of the Debian desktop. Then in the search bar enter Terminal, When the terminal icon appears, click on it to launch it.
Now go to the extracted configuration by running the following command in Terminal:
$ cd /home/user/Downloads/veracrypt-1.2.3-setup
replace user with the username of your system.
In the extracted installation folder, it is possible to use the configuration with a graphical interface or command line to install VeraCrypt. There is also a 32-bit and 64-bit setup. You can select an option depending on the requirements of your system. To install VeraCrypt using the console, use the following command:
To install VeraCrypt using the graphical interface, use the following command:
We will use the graphical interface, as graphically easier to work.
Now you will see the GUI settings for installing VeraCrypt. click Install VeraCrypt,
Press on I accept and agree to be bound by the terms of the license accept VeraCrypt terms.
click Ok start the installation.
If you are prompted for a sudo password, enter the password and wait a while until the installation is complete. When done click To come in get out of the window.
After the installation is complete, you can launch the VeraCrypt application from the application launch bar. Press the Windows key on the keyboard, and then type veracrypt in the search bar. When the VeraCrypt icon appears, click on it to launch.
Or just type veracrypt in Terminal and press Enter to start it.
Partition Encryption with VeraCrypt
VeraCrypt offers two types of encrypted volumes:
- Encrypted Files Container: It generates a virtual encrypted disk in the file.
- Encrypted volume inside a partition or disk: It encrypts an existing hard drive, hard drive partition, or external drive.
Here are the steps to encrypt the partition:
- Create Encrypted Volume
- Mount encrypted volume
- Dismantle encrypted volume
Now we will complete these steps one by one:
Step 1. Create an Encrypted Volume
In the VeraCrypt application window, click on Create volume, This launches the Volume Creation Wizard.
Now the wizard will ask if you want to create an encrypted file container or encrypt the hard disk partition. Here, in this article, we are going to create an encrypted volume, so select Create Volume in Partition / Diskthen click on following,
Now you need to decide whether you want to create a standard or hidden VeraCrypt volume. Select a volume type and click following,
Further in Tom Location screen click on Select device, Here you can select the drive or partition that you want to encrypt. But note that VeraCrypt will erase and format this section, so all data on it will be deleted.
Now select the partition or drive to encrypt and click Ok,
Then click on following go to the next step.
in Encryption options window, you can choose an encryption algorithm. This is the algorithm that will be used to encrypt the partition. By default, the encryption algorithm is AES, and the hah algorithm is SHA-512. Leave the default setting and click following,
Further in Loud password enter your password twice. This password will be used to access the encrypted partition. You must be sure that you remember this password, otherwise you will no longer have access to the data. After that click on following,
Further in Format options select the type of file system from the drop-down menu. Then click following,
You are now ready to create the volume. in Volume format window click on Format start formatting and create a volume.
When the process is completed, it will display a message stating that the volume was created successfully. click Ok,
Step 2. Mount the encrypted volume
Now you will need to mount the volume you just created. In the main VeraCrypt window, click Select device,
Now you need to select the desired partition in which you want to mount the volume. Select a drive or partition in the window that opens and click Ok,
After selecting the desired section, press mountain The button below to set the volume.
VeraCrypt prompts you to enter a password. Enter the password that you specified when creating the encrypted volume, and click Ok,
You will now notice that the top slot on the VeraCrypt main screen is filled with a mapped volume.
Open the file manager on your Debian OS and click Another places, you will see the installed volume. Now you can refer to it as a regular disk and copy and paste files into it while it is mounted there.
Step 3. Unmount the encrypted volume
As soon as you finish working with the connected volume, you will need to disconnect it. To do this, return to the main VeraCrypt window, select a volume, and then click dismount,
That is all there is to it! So, you configured and encrypted the volume on your system. Now that you want to access it, just mount it and enter the password. However, be sure to disconnect the volume after using it. Otherwise, it will be open to anyone who has access to your system. VeraCrypt can also be used to encrypt an entire drive and even individual folders and external drives such as USB.
How to encrypt Linux partitions using VeraCrypt in Debian 10