LWN: Comments on "Adiantum: encryption for the low end" https://lwn.net/Articles/776721/ This is a special feed containing comments posted to the individual LWN article titled "Adiantum: encryption for the low end". en-us Sat, 11 Oct 2025 08:14:33 +0000 Sat, 11 Oct 2025 08:14:33 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Adiantum: encryption for the low end https://lwn.net/Articles/778535/ https://lwn.net/Articles/778535/ mcortese <div class="FormattedComment"> <font class="QuotedText">&gt; Low-end devices bound for developing countries [...] lack encryption support because the hardware doesn't provide any cryptographic acceleration.</font><br> <p> Many laptops from less than 5 years ago not targeted at developing countries are equipped with Celeron processors with no AES-NI support as well.<br> </div> Tue, 05 Feb 2019 19:01:13 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777071/ https://lwn.net/Articles/777071/ zyzzyva <div class="FormattedComment"> <font class="QuotedText">&gt; Is there any reason not change the `crytsetup` default to be 4K?</font><br> <p> (1) Compatibility with old kernels and cryptsetup versions. The 4K encryption sector support is still fairly new, after all.<br> <p> (2) It's not guaranteed safe on disks with 512-byte sectors, as it can break atomicity guarantees that might be assumed by software. I don't believe this is a problem on modern disks or flash storage, nor on ext4 or f2fs. But the cryptsetup default needs to be more conservative.<br> </div> Thu, 17 Jan 2019 23:57:48 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777060/ https://lwn.net/Articles/777060/ jhoblitt <div class="FormattedComment"> It took some fiddling around to discover it, but this is the procedure to list the sector size on an existing device. I've poked at several systems and at least as of f28, the install wizard doesn't seem to be changing the default sector size.<br> <p> ```<br> $ sudo dmsetup ls --target crypt<br> luks-4b88e721-274f-44de-8668-c1bda37ee74b (253, 0)<br> luks-8ec7f0a1-5670-400c-9b0e-809cf65aa09d (253, 4)<br> $ sudo cryptsetup status luks-8ec7f0a1-5670-400c-9b0e-809cf65aa09d<br> /dev/mapper/luks-8ec7f0a1-5670-400c-9b0e-809cf65aa09d is active and is in use.<br> type: LUKS1<br> cipher: aes-xts-plain64<br> keysize: 512 bits<br> key location: dm-crypt<br> device: /dev/sda2<br> sector size: 512<br> offset: 4096 sectors<br> size: 1462509568 sectors<br> mode: read/write<br> ```<br> <p> There also isn't any mention of setting the sector size in the fedora wiki: <a href="https://fedoraproject.org/wiki/Disk_Encryption_User_Guide">https://fedoraproject.org/wiki/Disk_Encryption_User_Guide</a> nor does there appear to be a builtin mechanism to configure it via kickstart but, presumably, it could be done in a `%pre` block.<br> <p> Is there any reason not change the `crytsetup` default to be 4K?<br> </div> Thu, 17 Jan 2019 22:29:06 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777054/ https://lwn.net/Articles/777054/ zyzzyva <div class="FormattedComment"> Yes, the dm-crypt sector size is a creation-time parameter. The default is 512 bytes, but since Linux v4.12 larger sizes are supported. With cryptsetup/LUKS, 4K sectors require cryptsetup v2.0.0+ and using the LUKS2 format. cryptsetup v2.0.6+ supports Adiantum; an example format command with Adiantum is:<br> <p> cryptsetup luksFormat --type luks2 --sector-size 4096 -c xchacha12,aes-adiantum-plain64 -s 256 &lt;device&gt;<br> <p> But 4K sectors can be used with other ciphers too.<br> <p> Meanwhile, fscrypt (which will also support Adiantum in Linux v5.0) has always encrypted file contents in 4K blocks.<br> </div> Thu, 17 Jan 2019 22:02:04 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777048/ https://lwn.net/Articles/777048/ zyzzyva <div class="FormattedComment"> Adiantum is not "bad encryption". Not only does it use modern ciphers with 256-bit keys and substantial security margins, but it's also the first wide-block encryption mode in the kernel. Wide-block modes (tweakable super-pseudorandom permutations) are the state of the art in disk encryption research as they protect against a stronger class of adversary than narrow-block modes such as XTS, LRW, and CBC.<br> <p> Storage encryption in Android is local to the device; by design other devices cannot decrypt the data. This includes SD cards used as "adoptable storage". SD cards used as "removable storage" are actually unencrypted FAT as that is the lowest common denominator among all computers and devices; the availability of a new encryption algorithm on some devices will not change that.<br> </div> Thu, 17 Jan 2019 21:40:31 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777034/ https://lwn.net/Articles/777034/ faramir <div class="FormattedComment"> While for this specific use case (encryption of dedicated local storage) the idea of introducing less expensive encryption options is preferable to nothing, I'm worried about how this could bleed into other use cases. We've seen a number of cases where people attack communications systems which allow a choice of encryption options by forcing use of a weak or broken option in order to intercept or modify data. In the world of USB flash drives, in general, we are stuck with the FAT filesystem because that's the only thing that every device can handle. Even low-end devices often have some way to use them with removable storage (USB OTG, microSD cards). I would hate for everyone to use "bad" encryption on such devices just because that was the only option that everyone supported. At a minimum, I hope that vendors continue to ship devices that support all of the options no matter how slow the implementation might be. I would even encourage making the more secure option the default for removable storage when a user requests such device to be formatted securely.<br> </div> Thu, 17 Jan 2019 19:28:08 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777030/ https://lwn.net/Articles/777030/ zyzzyva <div class="FormattedComment"> <font class="QuotedText">&gt; Does this mean that aes instructions aren't expected to be common up-coming low-end ~armv7 cores but neon is and/or a migration armv8 isn't happening any time soon?</font><br> <p> Yes for some markets; many new low-end devices are still being designed and shipped with 32-bit processors like Cortex-A7 that lack AES instructions, and it's unclear when this will change. They do have NEON still. Also even some low-end ARMv8 processors, e.g. Cortex-A53 in some SoCs, lack AES instructions.<br> <p> <font class="QuotedText">&gt; If armv8 isn't going to be common on the low end, at least for android devices, does that mean the google play 2021 64bit app deadline won't apply to some markets?</font><br> <p> This is answered in the announcement (<a href="https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html">https://android-developers.googleblog.com/2019/01/get-you...</a>). The requirement is that apps provide 64-bit versions, not that they cannot provide 32-bit versions; Play will continue to support 32-bit. Also it doesn't apply to apps explicitly targeting Wear OS or Android TV.<br> </div> Thu, 17 Jan 2019 18:57:33 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777019/ https://lwn.net/Articles/777019/ jhoblitt <div class="FormattedComment"> If armv8 isn't going to be common on the low end, at least for android devices, does that mean the google play 2021 64bit app deadline won't apply to some markets?<br> </div> Thu, 17 Jan 2019 16:14:51 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777018/ https://lwn.net/Articles/777018/ jhoblitt <div class="FormattedComment"> ^typo: s/block size/sector size/<br> </div> Thu, 17 Jan 2019 16:11:07 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/777011/ https://lwn.net/Articles/777011/ jhoblitt <div class="FormattedComment"> Does this mean that aes instructions aren't expected to be common up-coming low-end ~armv7 cores but neon is and/or a migration armv8 isn't happening any time soon?<br> </div> Thu, 17 Jan 2019 16:10:16 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/776994/ https://lwn.net/Articles/776994/ jhoblitt <div class="FormattedComment"> I don't know if it is realistic to change the block size after the fact I suspect it is a creation time parameter from looking at `man 8 cryptsetup`.<br> <p> ```<br> --sector-size &lt;bytes&gt;<br> Set sector size for use with disk encryption. It must be power<br> of two and in range 512 - 4096 bytes. The default is 512 bytes<br> sectors. This option is available only in the LUKS2 mode.<br> <p> Note that if sector size is higher than underlying device hard‐<br> ware sector and there is not integrity protection that uses data<br> journal, using this option can increase risk on incomplete sec‐<br> tor writes during a power fail.<br> <p> If used together with --integrity option and dm-integrity jour‐<br> nal, the atomicity of writes is guaranteed in all cases (but it<br> cost write performance - data has to be written twice).<br> <p> Increasing sector size from 512 bytes to 4096 bytes can provide<br> better performance on most of the modern storage devices and<br> also with some hw encryption accelerators.<br> ```<br> </div> Thu, 17 Jan 2019 15:59:14 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/776981/ https://lwn.net/Articles/776981/ Sesse <div class="FormattedComment"> <font class="QuotedText">&gt; To get good performance some dm-crypt users will need to use 4096-byte sectors rather than the default of 512, but they really ought to be doing so anyway.</font><br> <p> Wait, are you saying the default in LUKS is 512? How can I see what I'm using? Can I change it without a luksFormat with --sector-size?<br> </div> Thu, 17 Jan 2019 13:03:40 +0000 Adiantum: encryption for the low end https://lwn.net/Articles/776959/ https://lwn.net/Articles/776959/ zyzzyva <div class="FormattedComment"> Thanks for reporting on this work! A few clarifications:<br> <p> <font class="QuotedText">&gt; As a replacement, the Adiantum encryption mode was developed</font><br> <p> FWIW, we started work on this even before we proposed Speck128-XTS as a faster-to-deploy solution. So it's been in the works for longer than it may seem. Though, naturally development did speed up when it became clear there wouldn't be an interim solution.<br> <p> <font class="QuotedText">&gt; Speck mostly fit the bill, but it turns out that Adiantum is even faster (roughly 30%), so the political issues that made Speck untenable turned out to be a boon for users.</font><br> <p> To be clear, Adiantum is only faster on sufficiently long messages; the 30% number is for 4096-byte messages. But that's fine for the intended use cases. To get good performance some dm-crypt users will need to use 4096-byte sectors rather than the default of 512, but they really ought to be doing so anyway.<br> <p> <font class="QuotedText">&gt; The encryption cipher used is XChaCha12, which is a block cipher based on the ChaCha family of stream ciphers.</font><br> <p> XChaCha12 is still a stream cipher; it just accepts a longer nonce than ChaCha12.<br> <p> <font class="QuotedText">&gt; Two rounds of XChaCha12</font><br> <p> Normally there is just one XChaCha12 invocation per encryption or decryption. There's another to derive subkeys, but that's only needed when setting a new key.<br> <p> <font class="QuotedText">&gt; According to Biggers, this provides a better security margin than HPolyC or AES.</font><br> <p> I didn't say exactly that :-) Adiantum and HPolyC both use the same cryptographic primitives: XChaCha12 and AES-256. So their "security margin" under the usual definition (percent of total rounds the best attack doesn't reach) is the same, and can't really be better than XChaCha12's or AES-256's alone. But that's not the only measure of security; for example, slightly more messages can be safely encrypted with the same key with Adiantum than HPolyC, due to the different choice of universal hash function family. (Though, in practice it doesn't matter as the number of messages is extremely large in both cases!)<br> </div> Thu, 17 Jan 2019 03:49:01 +0000