Eric Biggers 209e6167b5 Exclude cipher allocation time from benchmark
For each 1 MiB of data en/decrypted, 'cryptsetup benchmark' is setting
up a new AF_ALG socket, which involves 4 system calls and is included in
the data en/decryption time.  With high-speed ciphers (e.g. VAES
optimized AES-XTS) this can measure well over 10000 AF_ALG socket setups
per second.  This is not representative of dm-crypt, which only
allocates a cipher when the dm-crypt device is created.

Therefore, allocate the AF_ALG socket once, before doing the benchmark.

On AMD Ryzen 9 9950X this increases the 'cryptsetup benchmark' result of
AES-256-XTS slightly, from 14000 MiB/s to 14600 MiB/s.

Note that an in-kernel benchmark of the crypto API with the same block
size (65536 bytes) gives 34100 MiB/s, so AF_ALG still takes more time
than the en/decryption itself -- this cannot easily be addressed though.

Signed-off-by: Eric Biggers <ebiggers@google.com>
2024-09-17 10:31:10 -07:00
2024-09-02 15:38:59 +02:00
2022-10-04 13:00:10 +02:00
2024-07-30 14:14:22 +02:00
2024-08-26 16:39:10 +00:00
2024-08-22 14:06:21 +00:00
2019-10-31 20:02:51 +01:00
2024-07-14 17:12:03 +08:00
2024-06-17 11:52:56 +00:00
2024-06-17 11:52:56 +00:00
2024-07-14 17:12:03 +08:00
2024-07-14 17:12:03 +08:00
2024-06-03 16:38:15 +00:00
2024-09-03 11:54:48 +02: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.7.5

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

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

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 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.

Languages
C 74.8%
Shell 20.9%
Meson 1.7%
C++ 1.2%
M4 1%
Other 0.4%