Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Linux Unified Key Setup

From Wikipedia, the free encyclopedia
(Redirected fromLUKS)
Disk encryption software
"LUKS" redirects here. For the American painter, seeGeorge Luks.

TheLinux Unified Key Setup (LUKS) is adisk encryption specification created by Clemens Fruhwirth in 2004 and originally intended forLinux.

LUKS implements a platform-independent standard on-disk format for use in various tools. This facilitates compatibility and interoperability among different programs and operating systems, and assures that they all implementpassword management in a secure and documented manner.[1]

Description

[edit]

LUKS is used to encrypt ablock device. The contents of the encrypted device are arbitrary, and therefore any filesystem can be encrypted, includingswap partitions.[2] There is an unencryptedheader at the beginning of an encrypted volume, which allows up to 8 (LUKS1) or 32 (LUKS2)encryption keys to be stored along with encryption parameters such as cipher type and key size.[3][4]

The presence of this header is a major difference between LUKS anddm-crypt, since the header allows multiple different passphrases to be used, with the ability to change and remove them. If the header is lost or corrupted, the device will no longer be decryptable.[5]

Encryption is done with a multi-layer approach. First, the block device is encrypted using amaster key. This master key is encrypted with each activeuser key.[6] User keys are derived from passphrases,FIDO2 security keys,TPMs orsmart cards.[7][8] The multi-layer approach allows users to change their passphrase without re-encrypting the whole block device. Key slots can contain information to verify user passphrases or other types of keys.

There are two versions of LUKS, with LUKS2 featuring resilience to header corruption, and using theArgon2key derivation function by default, whereas LUKS1 usesPBKDF2.[9] Conversion between both versions of LUKS is possible in certain situations, but some features may not be available with LUKS1 such as Argon2.[3] LUKS2 usesJSON as a metadata format.[3][10]

Available cryptographic algorithms depend on individual kernel support of the host.Libgcrypt can be used as a backend for hashing, which supports all of its algorithms.[11] It is up to the operating system vendor to choose the default algorithm.[12] LUKS1 makes use of ananti-forensics technique called AFsplitter, allowing for securedata erasure and protection.[13]

LUKS with LVM

[edit]

Logical Volume Management can be used alongside LUKS.[14]

LVM on LUKS
When LVM is used on an unlocked LUKS container, all underlying partitions (which are LVM logical volumes) can be encrypted with a single key. This is akin to splitting a LUKS container into multiple partitions. The LVM structure is not visible until the disk is decrypted.[15]
LUKS on LVM
When LUKS is used to encrypt LVM logical volumes, an encrypted volume can span multiple devices. The underlying LVM volume group is visible without decrypting the encrypted volumes.[16]

Full disk encryption

[edit]
Debian-Installer showing an option for automated partitioning withLVM on LUKS

A common usage of LUKS is to providefull disk encryption, which involves encrypting theroot partition of an operating system installation, which protects the operating system files from beingtampered with or read byunauthorized parties.[14]

On a Linux system, theboot partition (/boot) may be encrypted if thebootloader itself supports LUKS (e.g.GRUB). This is undertaken to prevent tampering with theLinux kernel. However, thefirst stage bootloader or anEFI system partition cannot be encrypted (seeFull disk encryption#The boot key problem).[14]

On mobile Linux systems,postmarketOS has developedosk-sdl to allow a full disk encrypted system to be unlocked using a touch screen.

For systems runningsystemd, thesystemd-homed component can be used to encrypt individualhome directories.[17]

Operating system support

[edit]

Thereference implementation for LUKS operates on Linux and is based on an enhanced version ofcryptsetup, usingdm-crypt as the disk encryption backend. UnderMicrosoftWindows, LUKS-encrypted disks can be used via theWindows Subsystem for Linux.[18] (Formerly, this was possible with LibreCrypt,[19] which currently has fundamental security holes,[20][21] and which succeededFreeOTFE, formerly DoxBox.)

DragonFly BSD supports LUKS.[22]

Installer support

[edit]

Several Linux distributions allow the root device to be encrypted upon OS installation. These installers includeCalamares,[23]Ubiquity,[24]Debian-Installer,[25] and more.

On-disk format

[edit]

LUKS headers are backward compatible; newer versions of LUKS are able to read headers of previous versions.[26]

LUKS1

[edit]
LUKS1 Header[26]
OffsetData typeDescription
00hexchar[6]Magic number {'L', 'U', 'K', 'S', 0xBA, 0xBE }
66hexuint16_tLUKS Version (0x0001 for LUKS1)
88hexchar[32]Cipher Algorithm (e.g. "twofish", "aes")
4028hexchar[32]Cipher mode (e.g. "cbc-essiv:sha256")
7248hexchar[32]Cryptographic hash function (e.g. "sha1", "ripemd160")
10468hexuint32_tPayload offset (position of encrypted data) in 512 byte offsets
1086Chexuint32_tNumber of key bytes
11270hexchar[20]PBKDF2 master keychecksum
13284hexchar[32]PBKDF2 master key salt parameter
164A4hexuint32_tPBKDF2 master key iterations (Default: 10)
168A8hexchar[40]UUID of the partition (e.g. "504c9fa7-d080-4acf-a829-73227b48fb89")
208D0hex(48 Bytes)Keyslot 1
544220hex(48 Bytes)Keyslot 8
592 Bytes total
Format of each keyslot
OffsetData typeDescription
0uint32_tState of keyslot: Active=0x00AC71F3; Disabled=0x0000DEAD
4uint32_tPBKDF2 iteration parameter
8char[32]PBKDF2 salt parameter
40uint32_tStart sector of key
44uint32_tNumber of anti-forensic stripes (Default: 4000)
48 Bytes total

LUKS2

[edit]

LUKS2 devices begin with a binary header intended to allow recognition and fast detection byblkid, which also contains information such aschecksums. All strings used in a LUKS2 header arenull-terminated strings. Directly after the binary header comes the JSON area, containing the objectsconfig (configuration),keyslots,digests,segments (describes encrypted areas on the disk), andtokens containing extra metadata.[10]

The binary format for regularluks2 keyslots are mostly similar to their predecessor, with the addition of different per-keyslot algorithms. Another type of key exists to allow redundancy in the case that a re-encryption process is interrupted.[10]

Examples

[edit]

Cryptsetup is the reference implementation of the LUKS frontend.

To encrypt a device with the path/dev/sda1:

#cryptsetupluksFormat/dev/sda1

To unlock an encrypted device, wherename is themapped device name:

#cryptsetupopen/dev/sda1name

Re-encrypting

[edit]

Re-encrypting a LUKS container can be done either with thecryptsetup tool itself, or with a legacy tool calledcryptsetup-reencrypt. These tools can also be used to add encryption to an existing unencrypted filesystem, or remove encryption from a block device.[11][27]

Both methods have similar syntax:

#cryptsetupreencrypt/dev/sda1
#cryptsetup-reencrypt/dev/sda1

See also

[edit]

References

[edit]
  1. ^Fruhwirth, Clemens (2018-01-20)."LUKS On-Disk Format Specification Version 1.2.3"(PDF). Retrieved2021-09-23.
  2. ^"Encrypting drives using LUKS".Fedora Docs. Retrieved6 May 2022.
  3. ^abc"Chapter 12. Encrypting block devices using LUKS".Red Hat Customer Portal.
  4. ^"How to Encrypt Hard Disk (partition) using LUKS in Linux". 27 February 2019.
  5. ^"How to Encrypt Your Data with dm-crypt".Linode. 22 November 2022.
  6. ^Bossi, Simone; Visconti, Andrea (2015)."What Users Should Know About Full Disk Encryption Based on LUKS"(PDF).{{cite journal}}:Cite journal requires|journal= (help)
  7. ^"systemd-cryptenroll - ArchWiki".wiki.archlinux.org. Retrieved2023-11-22.
  8. ^"How to encrypt a LUKS container using a smart card or token". 20 April 2014.
  9. ^"How LUKS works with Full Disk Encryption in Linux". 25 September 2021.
  10. ^abc"on-disk-format-luks2.pdf"(PDF). 7 March 2024.
  11. ^abcryptsetup(8) – Linux Administration and Privileged CommandsManual
  12. ^"Breaking LUKS Encryption".eForensics. 21 August 2020.
  13. ^"AFsplitter".
  14. ^abc"dm-crypt/Encrypting an entire system". Retrieved6 May 2022.
  15. ^"Arch with LVM on LUKS".
  16. ^"LUKS on LVM: encrypted logical volumes and secure backups". 12 September 2014.
  17. ^"Home Directories".systemd.
  18. ^"Servicing the Windows Subsystem for Linux (WSL) 2 Linux Kernel".Microsoft Developer Blogs. 16 April 2021.
  19. ^"LibreCrypt".GitHub. 27 July 2022.
  20. ^"Flaw in driver allows privilege escalation. Feedback wanted · Issue #38 · t-d-k/LibreCrypt".GitHub. 30 September 2015.
  21. ^"Driver allows writing to arbitrary devices · Issue #39 · t-d-k/LibreCrypt".GitHub. 7 October 2015.
  22. ^"DragonFly's Major Features List". Retrieved6 May 2022.
  23. ^Michael Larabel (8 May 2016)."Calamares Installer Adds LUKS Encryption Support".Phoronix.
  24. ^"How to Encrypt Your Hard Disk in Ubuntu".Make Tech Easier. 13 January 2017.
  25. ^"PartmanCrypto".Debian Wiki. Retrieved6 May 2022.
  26. ^ab"LUKS On-Disk Format Specification"(PDF).
  27. ^"CRYPTSETUP-REENCRYPT(8) Man page".man7.org.

External links

[edit]
Linux kernel
Controversies
Distributions
Organizations
Adoption
Media
Professional related certifications
Email clients
Secure
communication
OTR
SSH
TLS & SSL
VPN
ZRTP
P2P
DRA
Disk encryption
(Comparison)
Anonymity
File systems(List)
Security-focused
operating system
Service providers
Educational
Anti–computer forensics
Related topics
Retrieved from "https://en.wikipedia.org/w/index.php?title=Linux_Unified_Key_Setup&oldid=1239229939"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp