Guilhem Moulin wrote:
> On Mon, 14 Jul 2025 at 10:14:51 +0100, Justin B Rye wrote:
>> I still have no real idea what the use case for "plain mode" is, or
> 
> Plain mode *is* used, I don't think the release notes is about
> questioning users' use case.  As I wrote earlier, both upstream and
> Debian recommend LUKS for non-transient devices, but some use it anyway
> and the release notes should warn them about it.
[...]

Never mind all this beating me over the head with HOWTO information,
let's skip to the part where you answer my WHYTO question: encrypted
swap!  Thanks, now it makes sense.

[...]
> Mapping a
> device with different encryption parameters will yield a device
> containing data indistinguishable from random (it does *not* fail).  If
> the user is expecting to contain a file system or some kind of
> persistent data, that's obviously problematic.  If the device is meant
> to be used for ephemeral storage, for instance for an encrypted swap
> partition, that's not a big deal.

Okay, so talking about "accessing" the device may be misleading.
Revised version below...

>>>> This does not apply to LUKS devices because LUKS records the settings
>>>> in the device itself.
>>>>
>>>> To properly configure your plain-mode devices, assuming they were
>>>> created with the bookworm defaults, you should add
>>>> ``cipher=aes-cbc-essiv:sha256,hash=ripemd160`` to ``/etc/crypttab``.
>>> 
>>> …,size=256
>> 
>> That is, make it
>>  ``cipher=aes-cbc-essiv:sha256,hash=ripemd160,siz=256`` to ``/etc/crypttab``.
> 
> I'd suggest
> 
>    ``cipher=aes-cbc-essiv:sha256,size=256,hash=ripemd160``
> 
> as the key size goes along with the cipher algorithm, while the hash
> function does not (it's merely used for key derivation).

For consistency I'll put "size" second in the listing of options
above, too.
 
>>>> To access such devices with ``cryptsetup`` on the command line you can
>>>> use ``--cipher aes-cbc-essiv:sha256 --hash ripemd160``.  Debian
>>> 
>>> … --key-size 256
>> 
>>  use ``--cipher aes-cbc-essiv:sha256 --hash ripemd160 --key-size 256``.  
>> Debian
> 
> Similarly,
> 
>     ``--cipher aes-cbc-essiv:sha256 --key-size 256 --hash ripemd160``
> 
>>  recommends that you configure permanent devices with LUKS, or if you do use
>>  plain mode, that you explicitly record all the encryption settings [...]
>>
>> […]
>>
>> So maybe this combines with my last comment as
>> [...] that you explicitly record all the required encryption settings
> 
> Sounds good.

So revisions so far:

  change to default encryption settings for plain-mode dm-crypt devices
  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  The default settings for ``dm-crypt`` devices created using
  ``plain``-mode encryption (see :url-man-stable:`crypttab(5)) have
  changed to improve security. This will cause problems if you did not
  record the settings used in ``/etc/crypttab``. The recommended way
  to configure plain-mode devices is to record the options ``cipher``,
  ``size`, and ``hash`` in ``/etc/crypttab``; otherwise `cryptsetup`
  will use default values, and the defaults for cipher and hash
  algorithm have changed in trixie, which will cause such devices to
  appear as random data until they are properly configured.

  This does not apply to LUKS devices because LUKS records the settings
  in the device itself.

  To properly configure your plain-mode devices, assuming they were
  created with the bookworm defaults, you should add
  ``cipher=aes-cbc-essiv:sha256,size=256,hash=ripemd160`` to
  ``/etc/crypttab``.

  To access such devices with ``cryptsetup`` on the command line you can
  use ``--cipher aes-cbc-essiv:sha256 --key-size 256 --hash ripemd160``.
  Debian recommends that you configure permanent devices with LUKS, or
  if you do use plain mode, that you explicitly record all the required
  encryption settings in ``/etc/crypttab``. The new defaults are
  ``cipher=aes-xts-plain64,hash=sha256``.

Or does that last line look as if it's saying to remove "size"?  If
so, we could say that the defaults are

  ``cipher=aes-xts-plain64`` and ``hash=sha256``.
-- 
JBR     with qualifications in linguistics, experience as a Debian
        sysadmin, and probably no clue about this particular package

Reply via email to