@@ -338,11 +338,14 @@ Supported modes
338
338
339
339
Currently, the following pairs of encryption modes are supported:
340
340
341
- - AES-256-XTS for contents and AES-256-CTS- CBC for filenames
341
+ - AES-256-XTS for contents and AES-256-CBC-CTS for filenames
342
342
- AES-256-XTS for contents and AES-256-HCTR2 for filenames
343
343
- Adiantum for both contents and filenames
344
- - AES-128-CBC-ESSIV for contents and AES-128-CTS-CBC for filenames
345
- - SM4-XTS for contents and SM4-CTS-CBC for filenames
344
+ - AES-128-CBC-ESSIV for contents and AES-128-CBC-CTS for filenames
345
+ - SM4-XTS for contents and SM4-CBC-CTS for filenames
346
+
347
+ Note: in the API, "CBC" means CBC-ESSIV, and "CTS" means CBC-CTS.
348
+ So, for example, FSCRYPT_MODE_AES_256_CTS means AES-256-CBC-CTS.
346
349
347
350
Authenticated encryption modes are not currently supported because of
348
351
the difficulty of dealing with ciphertext expansion. Therefore,
@@ -351,11 +354,11 @@ contents encryption uses a block cipher in `XTS mode
351
354
`CBC-ESSIV mode
352
355
<https://en.wikipedia.org/wiki/Disk_encryption_theory#Encrypted_salt-sector_initialization_vector_(ESSIV)> `_,
353
356
or a wide-block cipher. Filenames encryption uses a
354
- block cipher in `CTS- CBC mode
357
+ block cipher in `CBC-CTS mode
355
358
<https://en.wikipedia.org/wiki/Ciphertext_stealing> `_ or a wide-block
356
359
cipher.
357
360
358
- The (AES-256-XTS, AES-256-CTS- CBC) pair is the recommended default.
361
+ The (AES-256-XTS, AES-256-CBC-CTS ) pair is the recommended default.
359
362
It is also the only option that is *guaranteed * to always be supported
360
363
if the kernel supports fscrypt at all; see `Kernel config options `_.
361
364
@@ -364,7 +367,7 @@ upgrades the filenames encryption to use a wide-block cipher. (A
364
367
*wide-block cipher *, also called a tweakable super-pseudorandom
365
368
permutation, has the property that changing one bit scrambles the
366
369
entire result.) As described in `Filenames encryption `_, a wide-block
367
- cipher is the ideal mode for the problem domain, though CTS- CBC is the
370
+ cipher is the ideal mode for the problem domain, though CBC-CTS is the
368
371
"least bad" choice among the alternatives. For more information about
369
372
HCTR2, see `the HCTR2 paper <https://eprint.iacr.org/2021/1441.pdf >`_.
370
373
@@ -375,13 +378,13 @@ the work is done by XChaCha12, which is much faster than AES when AES
375
378
acceleration is unavailable. For more information about Adiantum, see
376
379
`the Adiantum paper <https://eprint.iacr.org/2018/720.pdf >`_.
377
380
378
- The (AES-128-CBC-ESSIV, AES-128-CTS- CBC) pair exists only to support
381
+ The (AES-128-CBC-ESSIV, AES-128-CBC-CTS ) pair exists only to support
379
382
systems whose only form of AES acceleration is an off-CPU crypto
380
383
accelerator such as CAAM or CESA that does not support XTS.
381
384
382
385
The remaining mode pairs are the "national pride ciphers":
383
386
384
- - (SM4-XTS, SM4-CTS- CBC)
387
+ - (SM4-XTS, SM4-CBC-CTS )
385
388
386
389
Generally speaking, these ciphers aren't "bad" per se, but they
387
390
receive limited security review compared to the usual choices such as
@@ -393,7 +396,7 @@ Kernel config options
393
396
394
397
Enabling fscrypt support (CONFIG_FS_ENCRYPTION) automatically pulls in
395
398
only the basic support from the crypto API needed to use AES-256-XTS
396
- and AES-256-CTS- CBC encryption. For optimal performance, it is
399
+ and AES-256-CBC-CTS encryption. For optimal performance, it is
397
400
strongly recommended to also enable any available platform-specific
398
401
kconfig options that provide acceleration for the algorithm(s) you
399
402
wish to use. Support for any "non-default" encryption modes typically
@@ -407,7 +410,7 @@ kernel crypto API (see `Inline encryption support`_); in that case,
407
410
the file contents mode doesn't need to supported in the kernel crypto
408
411
API, but the filenames mode still does.
409
412
410
- - AES-256-XTS and AES-256-CTS- CBC
413
+ - AES-256-XTS and AES-256-CBC-CTS
411
414
- Recommended:
412
415
- arm64: CONFIG_CRYPTO_AES_ARM64_CE_BLK
413
416
- x86: CONFIG_CRYPTO_AES_NI_INTEL
@@ -433,7 +436,7 @@ API, but the filenames mode still does.
433
436
- x86: CONFIG_CRYPTO_NHPOLY1305_SSE2
434
437
- x86: CONFIG_CRYPTO_NHPOLY1305_AVX2
435
438
436
- - AES-128-CBC-ESSIV and AES-128-CTS- CBC:
439
+ - AES-128-CBC-ESSIV and AES-128-CBC-CTS :
437
440
- Mandatory:
438
441
- CONFIG_CRYPTO_ESSIV
439
442
- CONFIG_CRYPTO_SHA256 or another SHA-256 implementation
@@ -521,7 +524,7 @@ alternatively has the file's nonce (for `DIRECT_KEY policies`_) or
521
524
inode number (for `IV_INO_LBLK_64 policies `_) included in the IVs.
522
525
Thus, IV reuse is limited to within a single directory.
523
526
524
- With CTS- CBC, the IV reuse means that when the plaintext filenames share a
527
+ With CBC-CTS , the IV reuse means that when the plaintext filenames share a
525
528
common prefix at least as long as the cipher block size (16 bytes for AES), the
526
529
corresponding encrypted filenames will also share a common prefix. This is
527
530
undesirable. Adiantum and HCTR2 do not have this weakness, as they are
0 commit comments