1
0
Fork 0
mirror of https://gitlab.com/cryptsetup/cryptsetup.git synced 2026-12-03 00:14:36 +00:00
Cryptsetup and LUKS - open-source disk encryption
  • C 75.1%
  • Shell 21.9%
  • Meson 1.6%
  • M4 1%
  • Makefile 0.3%
  • Other 0.1%
Find a file
Itai Handler 996b22d98d Allow encryption sector size up to 64 KiB for plain devices.
Linux kernel commit 1acc65c30f85 ("dm-crypt: allow encryption sector
size up to PAGE_SIZE") raises the encryption sector size limit of
plain dm-crypt devices from 4096 bytes to the page size (dm-crypt
target 1.30.0).

cryptsetup still caps the sector size at 4096 bytes, so it is not
possible to set up a plain dm-crypt device with sectors larger than
4 KiB, even on systems configured with pages larger than 4 KiB.

For plain devices, raise the cap to 64 KiB, the largest page size that
arm64 or ppc64 kernels can be configured with. LUKS stays at 4096
bytes. The kernel still enforces its own limit; if it refuses to
activate the device, report whether the sector size is larger than the
page size or the dm-crypt target is older than 1.30.0.

Assisted-by: LLM
2026-12-01 18:05:23 +02:00
.github/workflows ci: Update GitHub action scripts 2026-11-17 15:17:31 +01:00
.gitlab Revert "ci: Disable OPAL disk on trantor runner" 2026-11-23 18:26:55 +01:00
docs Update LUKS2 format specification document 2026-11-23 18:22:04 +01:00
lib Allow encryption sector size up to 64 KiB for plain devices. 2026-12-01 18:05:23 +02:00
m4 Rework build of fuzzers. 2022-10-04 13:00:10 +02:00
man Allow encryption sector size up to 64 KiB for plain devices. 2026-12-01 18:05:23 +02:00
misc Update spec version. 2026-04-02 15:59:16 +02:00
po po: update zh_CN.po (from translationproject.org) 2026-11-30 20:45:31 +01:00
scripts meson: introduce unquoted variable for path 2026-03-26 13:55:20 +01:00
src Allow encryption sector size up to 64 KiB for plain devices. 2026-12-01 18:05:23 +02:00
tests Allow encryption sector size up to 64 KiB for plain devices. 2026-12-01 18:05:23 +02:00
tokens Update copyright for 2026. 2026-06-06 22:32:07 +02:00
.codeql-config.yml Replace LGTM with GitHub CodeQL. 2023-03-07 13:51:04 +01:00
.gitignore Add compile_commands.json file to .gitignore. 2025-02-04 16:13:08 +01:00
.gitlab-ci.yml ci: split Valgrind job from others 2026-02-05 15:27:41 +01:00
AUTHORS Add Ondra to authors. 2019-10-31 20:02:51 +01:00
autogen.sh Always update automake library files if autogen.sh is run. 2022-08-01 08:47:34 +00:00
configure.ac Version 2.8.9. 2026-11-23 18:26:23 +01:00
CONTRIBUTING.md Add mention about AI to CONTRIBUTING.md 2026-04-17 10:40:08 +02:00
COPYING Fix FSF address in license text according to 2011-11-02 22:35:21 +00:00
FAQ.md Update kernel.org links to use CDN. 2025-06-03 09:54:49 +02:00
Makefile.am fuzz: Fix Makefile to build fuzzers only with fuzz-targets 2026-04-27 17:29:51 +02:00
meson.build Version 2.8.9. 2026-11-23 18:26:23 +01:00
meson_options.txt Add OPAL2 segment digest. 2026-11-23 14:39:29 +01:00
README.licensing Reorganize license files. 2024-06-03 16:38:15 +00:00
README.md Version 2.8.9. 2026-11-23 18:26:23 +01:00
SECURITY.md Add info about bug report to FAQ and add SECURITY.md file. 2022-02-23 22:20:09 +01:00

LUKS logo

What the ...?

Cryptsetup is an open-source utility used to conveniently set up disk encryption based on the dm-crypt kernel module.

These formats are supported:

  • plain volumes,
  • LUKS volumes,
  • loop-AES,
  • TrueCrypt (including VeraCrypt extension),
  • BitLocker, and
  • FileVault2.

The project also includes a veritysetup utility used to conveniently setup dm-verity block integrity checking kernel module and integritysetup to setup dm-integrity block integrity kernel module.

LUKS Design

LUKS is the standard for Linux disk encryption. By providing a standardized on-disk format, it not only facilitate compatibility among distributions, but also enables secure management of multiple user passwords. LUKS stores all necessary setup information in the partition header, which enables users to transport or migrate data seamlessly.

Specification and documentation

Download

Release notes and tarballs are available at kernel.org.

The latest stable cryptsetup release version is 2.8.9

Previous versions

Source and API documentation

For development version code, please refer to the source page, with mirrors at kernel.org and GitHub.

For libcryptsetup documentation see libcryptsetup API page.

NLS PO files are maintained by TranslationProject.

Required packages

All major Linux distributions provide cryptsetup as a bundled package. If you need to compile cryptsetup yourself, various additional packages are required. Any distribution-specific build tools are preferred when manually configuring cryptsetup.

Below are the packages needed to build for certain Linux distributions:

For Fedora:

git gcc make autoconf automake gettext-devel pkgconfig openssl-devel popt-devel device-mapper-devel libuuid-devel json-c-devel libblkid-devel findutils libtool libssh-devel tar rubygem-asciidoctor

Optionally: libargon2-devel libpwquality-devel

To run the internal testsuite (make check) you also need to install

sharutils device-mapper jq vim-common expect keyutils netcat shadow-utils openssh-clients openssh sshpass

For Debian and Ubuntu:

git gcc make autoconf automake autopoint pkg-config libtool gettext libssl-dev libdevmapper-dev libpopt-dev uuid-dev libsepol-dev libjson-c-dev libssh-dev libblkid-dev tar asciidoctor

Optionally: libargon2-0-dev libpwquality-dev

To run the internal testsuite (make check) you also need to install

sharutils dmsetup jq xxd expect keyutils netcat-openbsd passwd openssh-client sshpass

Note that the list may change as Linux distributions evolve.

Compilation

The cryptsetup project uses automake and autoconf system to generate all files needed to build. When building from a git snapshot,, use ./autogen.sh && ./configure && make to compile the project. When building from a release tar.xz tarball, the configure script is pre-generated (no need to run autoconf.sh). See ./configure --help and use the --disable-[feature] and --enable-[feature] options.

To run the test suite that come with the project, type make check. Note that most tests will need root user privileges and will run dangerous storage failure simulations. Do not run tests with root privilege on production systems! Some tests will need the scsi_debug kernel module to be installed.

For more details, please refer to the automake and autoconf documentation.

Help!

Documentation

Please read the following before posting questions to the mailing list so that you can ask better questions and better understand answers.

The FAQ is available online and in the source code for the project. The specifications are referenced above in this document. The man pages live within the source tree and should be available after installation using standard man commands, e.g. man cryptsetup.

Mailing List

For cryptsetup and LUKS related questions, please use the cryptsetup mailing list cryptsetup@lists.linux.dev, hosted at kernel.org subspace. To subscribe send an empty email message to cryptsetup+subscribe@lists.linux.dev.

You can also browse and/or search the mailing list archive. USEnet News (NNTP), Atom feed and git access to the public inbox is available through lore.kernel.org service.

The former dm-crypt list archive is also available.