+4 votes
208 views
How to encrypt a partition on Linux with DM-Crypt command

in Linux / Unix by (552k points)
reopened | 208 views

1 Answer

+5 votes
Best answer

1. Specify crypt table mapping line on Linux device

Currently there are various security methods that can be implemented within any organization with the aim of protecting the most valuable information of each user such as their data ..

The most effective and practical method that we can implement is to use some type of encryption for this task, and although we have several options at our disposal today we will talk about a special one that is part of the Linux distribution itself and does a really acceptable job and this It is dm-crypt.

For this we will use Ubuntu 17.10..

What is dm-crypt
DM (Device-mapper) is an infrastructure hosted in the core of Linux environments since versions 2.6 and 3.x which provides a generic way to create virtual layers of block devices of the data hosted there.

Dm-crypt (Device-mapper crypt) has been developed with the aim of offering transparent encryption of block devices using the crypto API kernel.

By using this command, as users we can specify a symmetric encryption, an encryption mode, a key (of any size, and later it will be possible to create a new block device in the root / dev..

All data stored in this route will be encrypted and the only possible way to read them will be deciphering your password, otherwise we will not have access to them.

We can mount this file system in a traditional way or stack the dm-crypt device with any other device such as RAID or LVM volumes.

To enable dm-crypt support, it will be necessary to enable CONFIG_DM_CRYPT on the device to use.

Something important to keep in mind is that most current Linux distributions have dm-crypt included by default in their system.

To configure it we must use the following user space components:

Device Mapper Library (part of the LVM2 package)
Cryptsetup.

All these packages are already included in the repository of the distribution to use.


1. Specify crypt table mapping line on Linux device


The allocation table in the device mapper is defined with the following syntax:
 <initial_sector> <size> <objective> <target mapping table> 
The components are:
  • Initial_sector is 0 (for tables that use only a mapped segment, the iow table contains only one line)
  • Size, refers to the device size in sectors
  • Objective is the name of the mapping objective

The sectors will always be 512 byte sectors.

image

Login Join up!


by (3.5m points)
edited

Related questions

+3 votes
1 answer
asked Oct 13, 2019 in Linux / Unix by backtothefuture (552k points) | 382 views
+5 votes
1 answer
+3 votes
1 answer
asked Sep 19, 2019 in Linux / Unix by backtothefuture (552k points) | 288 views
+5 votes
1 answer
asked Sep 2, 2020 in Security by backtothefuture (552k points) | 498 views
+4 votes
1 answer
asked Nov 2, 2019 in Security by backtothefuture (552k points) | 878 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users