|
|
Log in / Subscribe / Register

Ways to encrypt data on servers

By Jake Edge
September 16, 2026

FOSSY

At the 2026 edition of FOSSY, Romeo Solano gave a fast-paced, humorous presentation on what could have been a rather boring topic: server encryption. There are a number of threats that we face in today's world, from criminals, government overreach, espionage, and more, that can be thwarted with encryption. But encrypting data on a system that may live elsewhere, without any access to its keyboard at boot time, is rather more difficult than encrypting the disk of a laptop. Solano described the problems and gave a tour of some of the solutions in the talk.

The goal of the talk was to show attendees how to encrypt the data on their servers and to describe why they should do so. Encrypting the data at rest requires that the data be decrypted when the server is running, so he would be talking about how to do that at boot time, no matter whether the server was in the same room, another room in the house, or elsewhere on the globe. "You'll be able to accomplish this whether or not you can trust your hosting provider to lend you a helping hand."

The password prompt used when logging into a computer does "about as good a job at preventing access to your files" as a speed limit sign does to prevent speeding, Solano said. On the other hand, the disk-encryption-password prompt, "which looks incredibly similar but is slightly different", does actually prevent file access unless the decryption key is provided.

Encryption

Cryptography uses advanced math "beyond the understanding of most mortal humans, including myself". But that does not matter, users can still take advantage of cryptography without knowing or understanding the math underlying it. Because of that, it has become "standard operating procedure" for people to encrypt their computers and phones, especially for technical people like those in attendance at the talk (and the conference). "Why wouldn't my disks be encrypted at rest?"

[Romeo Solano]

It is more than just the risk of loss or theft, but to "protect against an increasingly snoopy and wants-to-know-everything-your're-doing international violence monopoly". It is a matter of course for many to power down their laptops and phones, thus encrypting their data, when going through a border checkpoint, for example. But much of the data users want to protect does not live on those devices, it is on a server somewhere.

When the server loses and regains power or needs to be rebooted for an urgent security update, though, the administrator may not be nearby to enter a password into the disk-encryption prompt. Maybe they are away on vacation; "I'm sorry honey, we have no Jellyfin for the next two weeks" is kind of a hard sell, he said. This is one of the reasons that people often leave their servers unencrypted.

The other main reason to not encrypt server data is because of a "real, tangible, potential performance impact" on reads and writes of data on encrypted disks. He showed numbers of 656MB per second versus 147MBps for the encrypted disk, which came from a 2020 Cloudflare blog post. The technical lead for the company, Ignat Korchagin, was looking into this performance degradation and found that a write to an encrypted filesystem ends up waiting in four separate queues before it reaches the disk. He patched the kernel to avoid that queueing and was able to get close to the same speed for unencrypted (696MBps) and encrypted (640MBps), though.

Those patches are part of the upstream kernel, so they can be enabled by anyone, Solano said. Those improvements only come for small I/O sizes, however, and performance can be even worse for large I/O. Each person needs to decide if the increased data security is worth the reduced performance; for him it is, but others may differ.

Threat model

It is unlikely that most users are facing movie-style heists in the data center, with people rappelling from the ceiling to grab servers or disks; "there's no laser beams or guard dogs". The real threat model that disk encryption is meant to thwart is someone taking a disk or server from the data center or a home lab. That means they now have the data—unless it is encrypted.

That threat may sound far-fetched, Solano said, but it happens frequently to small, community-run servers that are open to the public when a single person who uses it is accused of a crime. The police or other law-enforcement agencies confiscate the server for lengthy terms with little or no information about alleged crimes. It has also happened to regular people with their own servers that only they use; "they've had their homes ransacked and their equipment stolen", which lasts for years without any kind of charge being made. "This happens to the kind of people at FOSSY; this could happen to you."

There are other kinds of attacks, including cold boot attacks to recover encryption keys from the memory of a shut-down system. There are also evil maid attacks that swap out some hardware or software in the system, which allows the attacker to capture the decryption key. Those are real attacks, but they are "incredibly rare", targeted efforts that are outside of the scope of his threat model for the talk.

He reiterated that each administrator needs to decide for themselves whether encryption on the server makes sense for them and their users; he feels like he has a responsibility to protect his users' data, so the tradeoffs are worth it.

Key handling

There are ways to avoid the "inconvenience factor" of needing to provide the decryption key when the system restarts, so the trip to the data center—or even just down the hall to the server—can be eliminated. The first is "the worst possible method", which is a service called "remote hands" that most hosting providers offer; essentially it allows the use of the hands of an on-site technician, who can perform various tasks, including typing in a password. The dangers of that "should be immediately obvious". For one, the technician (and hosting company) have much less interest in keeping that key secure against bribery, theft, legal threats, and more; for another, many people have their server in a lab at home where there is no friendly technician available at all times.

A more desirable mechanism would be a way to remotely attach to the server system and type the password in. Server-class hardware generally has an extra network port, often labeled "IPMI" (for Intelligent Platform Management Interface). Connecting that to the local network, and creating a VPN connection to it, will allow accessing the system remotely, including its console, via a web browser. It is not a new technology, Solano said, but one that may not be all that well-known, especially among those with home labs.

The IPMI web server is running on a separate chip inside the system, not on the main CPU. That code only gets security updates infrequently, so it is important to have the VPN tunnel rather than exposing it on the internet. Hosting providers may not be willing or able to set that tunnel up—or they may promise that they can and then not actually do it for more than a year. "I don't know anything about that", he said with a sigh.

It would be even better to be able to use SSH to reach the server, but there is a chicken-and-egg problem in the way. The SSH daemon is normally on the root filesystem, which is encrypted and awaiting the decryption key from the console prompt. One solution to that is to use Dropbear SSH and to run it from the initial RAM disk (initramfs), which is the same place that the decryption-key console prompt is running from.

Depending on whether you believe the project's README file or its web site, Dropbear is "either 'smallish' or 'relatively small'". It lacks many of the features of the standard OpenSSH server, but "it is a lot smaller, and it's statically linked, it has no dependencies" so it can be easily placed in the initramfs. On Ubuntu systems (which is what he was using for his examples), it simply requires adding two packages (dropbear-initramfs and busybox-initramfs), modifying two configuration files, and doing a little more setup. The result is a system that allows SSH-key-based logins resulting in a BusyBox shell where the cryptroot-unlock command can be used to provide the disk-decryption key. Solano's talk notes have more information on setting up Dropbear in this fashion.

He uses both the IPMI virtual console and Dropbear solutions and likes them both—at least when he can get the VPN tunnel needed. Those mechanisms have something in common, though: they require that the administrator is available to type in the password. They cannot be asleep, hospitalized, or simply being inattentive to their systems because the system will not boot until the password is entered.

Unattended

It would be nice if there were an unattended solution where the server would only decrypt its disk if it is in a known safe state, but it would stay encrypted in the "cold, offline attack scenario that we are trying to protect against". As might be guessed, that is possible, by using two tools called Clevis and Tang, which are named after a two-piece fastener used in towing and farming, he said.

In the cryptography world, Tang is the server side that runs on some other internet host, while Clevis is the client side that runs from the initramfs as with Dropbear. Using Tang might sound like handing the key off to a remote technician, as mentioned earlier, but it is not. Tang does not know the key, nor does Clevis. He put up a slide (from his ODP slides) with a complicated-looking formula; "the way that it works is incredibly simple for some people, I am not some people", he said with a chuckle.

In order to explain, he used his cat and himself as metaphors for Tang and Clevis, respectively. When the two of them come together, because his cat jumps in his lap, say, they create a globally unique "shape" that corresponds to the decryption key. A different human or a different cat creates an entirely different key. Beyond that, Tang does not store anything about the encryption key (e.g. fingerprint) or retain any state about the Clevis on your system. "It's completely stateless, completely anonymous, no logs, no records, nothing, at least by default."

A single Clevis can use multiple Tangs, either individually or in groups. So a Clevis could require N Tangs in order to provide the disk-decryption key, for example. Installing Tang just requires a single package; it will run a server that listens on port 80, which is all that is needed. Clevis requires three packages and a command to bind a disk encrypted using Linux Unified Key Setup (LUKS) to the Tang server. Periodically, the Tang keys should be rotated, which can be done with a single command on the Tang server and another on the Clevis client. Once again, his notes provide more details.

Clevis and Tang can be used for more than just LUKS keys; they provide a general mechanism to derive secrets without storing the secret, which makes it different from what key escrow, or friendly technicians, require). In addition, Clevis can be bound to the Trusted Platform Module (TPM) chip. He personally does not trust the security of the TPM and is concerned that placing the disk-encryption key into a device on the system could result in key disclosure if there is some TPM exploit someday. But, "if you want to trust your TPM, Clevis has you covered."

Encrypted directories

The solutions he presented so far were all based on fully encrypted disks, where the root partition and everything else was protected. That is the way that all of his systems are set up, but it may not be realistic for every scenario. For example, the system may need to stay up, so it cannot afford the downtime required to encrypt it or it could be storing a huge amount of data that, due to storage costs, is too expensive to duplicate in order to encrypt it. In addition, virtual private server (VPS) systems from hosting providers may not provide a mechanism to encrypt the disks. For situations like those, other encryption options may make sense.

For example, Ubuntu has provided an installation option to encrypt a user's home directory for over 12 years. The regular user password is also the decryption key for the directory. It uses eCryptfs, which is unmaintained and will probably be deprecated soon, Solano said. It has been replaced with fscrypt, "which does the same exact thing, except that it doesn't have a cool logo or a mascot". It does, however, have a maintainer, which is probably more important.

Fscrypt is easy to set up as well. On ext4, the tune2fs command can be used to turn on encryption for the filesystem. Once that is done, the fscrypt command allows encrypting specific directories on the filesystem. There are other fscrypt subcommands to lock and unlock the encrypted directory; that can be scripted to run at login time, for example. "You can even have it reach out to Clevis and Tang to derive a decryption key" and handle it all automatically. Fscrypt is only available on a few filesystem types, but there are equivalent features on other filesystems, such as XFS and ZFS, he said.

Another option is using systemd-homed to create block devices that are "space-limited, encrypted, portable, even, across filesystems and servers". Each directory that systemd-homed creates is associated with a new user account that can handle the encryption needs for the system. At that point, Solano was running out of time, so he referred attendees to his talk notes.

After a summary conclusion of the talk, it turned out he had a bit of time for questions. One was: If the "men in black" take a server running Clevis, can't they just have it contact the Tang server to construct the decryption key? The answer is that they can do so as long as the Tang server(s) are still running and are willing to reply to the Clevis client running in a new location. Various levels of protection can be applied such that Tang servers only reply to certain IP addresses, or over certain networks, which could thwart Clevis operations from the captured systems.

In just a little bit over half an hour, Solano took a bit of whirlwind tour through the encryption options available to server administrators. Interested readers can view the video (minus the short Q&A).

[I would like to thank the Linux Foundation, LWN's travel sponsor, for its assistance with my trip to Vancouver for FOSSY.]

Index entries for this article
ConferenceFree and Open Source Software Yearly/2026


to post comments

Remote unlocking of (rooted) Android Devices

Posted Sep 16, 2026 15:13 UTC (Wed) by kxxt (subscriber, #172895) [Link]

Nice write-up! The same principle can also be used to remotely unlock Android devices.

Start a daemon on the phone after the DE storage automatically decrypts on boot, remotely contacting this daemon to unlock the CE storage that requires the user to provide the lock-screen password.

I wrote a blog post [1] about a tailscale-based approach to remotely unlocking Android devices.

[1]: https://www.kxxt.dev/blog/full-tailscale-on-android-and-r...

dmcrypt settings

Posted Sep 16, 2026 20:02 UTC (Wed) by dilinger (subscriber, #2867) [Link] (1 responses)

The lwn article doesn't mention the specific arguments (just links to the Cloudflare blog post), but for folks reading this: no-read-workqueue and no-write-workqueue in your /etc/crypttab is what you want. Eg,

somedisk UUID="aaaaa-bbbbb-cccc-dddd" /etc/crypt.key luks,no-read-workqueue,no-write-workqueue

About two years ago I noticed the performance issues with spinning hard drives and happened upon the same Cloudflare post, and have been happily using those settings ever since.

dmcrypt settings

Posted Sep 17, 2026 3:06 UTC (Thu) by mirabilos (subscriber, #84359) [Link]

I tested this on four systems and saw no difference… until I checked against cryptsetup benchmark (one of the systems was already as fast as that, slow as it is) and with unencrypted /boot (the three other systems were I/O-bound), oops…

… why does the NVMe SSD in the new $dayjob laptop only give me about 300 MiB/s? Or is that expected?

Encryption helps with decommissioning

Posted Sep 16, 2026 23:01 UTC (Wed) by ejr (subscriber, #51652) [Link]

Encryption is rather useful for provably decommissioning storage that has housed sensitive data. That's a serious win for various compliance requirements.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 3:18 UTC (Thu) by mirabilos (subscriber, #84359) [Link] (23 responses)

What’s to prevent the person who walked out of the door with a copy of my HDD, or the entire server, from just booting it up with a network connection and getting it unlocked, while nobody is available to shut down the Tang server?

Not even something like the server sends messages to a group of people saying “request from IP x for slot y, confirm or deny?” and waits for a response (which needs to be given over ssh or https with auth or something)…

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 5:30 UTC (Thu) by ssmith32 (subscriber, #72404) [Link]

I believe he referenced, what effectively would be, an iptables rule in front of the Clevis server with an strict allow list of ips. Or if you have a physical setup where part of your LAN is far less likely to be confiscated, keep it there, and opnsense.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 7:36 UTC (Thu) by yaap (subscriber, #71398) [Link] (20 responses)

The Tang server should only be locally accessible, not across the Internet. So on premise and restricted to the premise, or in a cloud set-up limited to a private subnet. This way a server stolen and booted elsewhere can't reach it.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 8:01 UTC (Thu) by taladar (subscriber, #68407) [Link] (19 responses)

So what you are saying is that the Tang server needs to be located where anyone stealing/confiscating the regular server you are trying to protect will just also steal/confiscate the Tang server too? That seems like a major flaw in the design of that system.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 8:04 UTC (Thu) by mjg59 (subscriber, #23239) [Link] (4 responses)

Corp network workstations typically live under a desk, corp network security infrastructure typically lives in a secure environment (and, ideally, in prod). Stealing the former is massively easier than stealing the latter.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 9:01 UTC (Thu) by eru (subscriber, #2753) [Link] (2 responses)

I think the context here was running a server at home, or in a small organisation. Neither is likely to have a heavily secured server room. One solution might be to have the Tang server be so small that it can be hidden in some nook (under floorboards for example), and connected wirelessly, so a search would likely miss it (unless it takes the house apart). But can you set up a wifi connection while in initrd?

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 10:48 UTC (Thu) by kpfleming (subscriber, #23250) [Link] (1 responses)

Taking that almost to the extreme... imagine a tiny ESP32 or RISC-V based board, powered via PoE, which has only the Tang server function, and can be hidden inside a cabinet or wall somewhere in the building.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 23:25 UTC (Thu) by mirabilos (subscriber, #84359) [Link]

Wouldn’t help for rented dedicated servers or VMs.

I don’t understand that Clevis/Tang setup

Posted Sep 18, 2026 7:50 UTC (Fri) by taladar (subscriber, #68407) [Link]

Why would I want to unlock a workstation automatically at all? That is what users in front of the workstation are for. This was discussed in the context of servers. I mean sure, there are some use cases for workstations maybe for remote maintenance but that is less of an issue since you could just supply the credentials from the workstation of the engineer doing the maintenance.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 9:49 UTC (Thu) by Silvermouse (subscriber, #159872) [Link]

You can setup multiple Tang servers and require all of them to be available. If one is kept remote and iptables-restricted, this attack vector wouldn't work.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 10:08 UTC (Thu) by farnz (subscriber, #17727) [Link] (11 responses)

In the case my employer uses it for, the Tang server is in a locked server cabinet, which itself is in a locked server room; you need to bypass physical security to get to it.

The protected Linux machines are more exposed - they're things like hardware-in-the-loop test heads, which are sited near the hardware they're testing (in turn, the hardware under test is often on display to visitors, because it looks pretty when it's running a test suite).

I believe this is the intended use of Clevis/Tang - protected Tang server behind several locks, providing security for more exposed Clevis clients.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 23:26 UTC (Thu) by mirabilos (subscriber, #84359) [Link] (10 responses)

What good does protecting the server do if the network to the protected server is not…

I don’t understand that Clevis/Tang setup

Posted Sep 18, 2026 8:19 UTC (Fri) by farnz (subscriber, #17727) [Link] (9 responses)

What makes you think that the network to the protected server is not protected in our use case? It is.

I don’t understand that Clevis/Tang setup

Posted Sep 18, 2026 19:54 UTC (Fri) by mirabilos (subscriber, #84359) [Link] (8 responses)

Look, I’m coming from the following setup:

- everything but the pihole has FDE, but “everything” here means:
- laptops
- a home server
- a dedicated server at some hoster, on the hoster’s hardware
- several VMs at multiple hosters

The current setup is with dropbear-initramfs and a custom hook that initialises IPv6 (one of the VMs has no IPv4, and another has an out-of-network default gateway, which the initramfs IPv4 code does not support). This means I can either type the password at boot or do the unlocking via SSH.

This setup suffers from precisely the problem of “what if the admin is away”, and I am wondering how it could‡ help with it.

‡) I’ve seen it’s “AI” slop, so this has become theoretical now anyway, except it would be possible to reimplement this if the *scheme* was sound, so it’s still a worthwhile discussion

I don’t understand that Clevis/Tang setup

Posted Sep 21, 2026 10:23 UTC (Mon) by paulj (subscriber, #341) [Link] (7 responses)

What has become AI slop?

I don’t understand that Clevis/Tang setup

Posted Sep 23, 2026 20:32 UTC (Wed) by skitt (subscriber, #5367) [Link] (6 responses)

I imagine the comment is referring to commits such as https://github.com/latchset/clevis/commit/4e4ad5e3d9a5b10... in Clevis/Tang.

I don’t understand that Clevis/Tang setup

Posted Sep 24, 2026 5:18 UTC (Thu) by zdzichu (subscriber, #17118) [Link] (5 responses)

What's wrong with this commit?

I don’t understand that Clevis/Tang setup

Posted Sep 24, 2026 9:26 UTC (Thu) by skitt (subscriber, #5367) [Link] (4 responses)

I didn’t intend to assign value to the commit, just give an example of commits whose co-authorship I suspect could have triggered the comment paulj was asking about.

I don’t understand that Clevis/Tang setup

Posted Sep 24, 2026 11:01 UTC (Thu) by zdzichu (subscriber, #17118) [Link] (3 responses)

"AI slop" has an inherent bad quality. The commit in question does not look bad.

I don’t understand that Clevis/Tang setup

Posted Sep 24, 2026 23:13 UTC (Thu) by mirabilos (subscriber, #84359) [Link] (2 responses)

The way I learnt it, the word is an acronym for “[AI] synthesised lies or plagiarism” and therefore applicable to everything regurgitated from an LLM.

I don’t understand that Clevis/Tang setup

Posted Sep 25, 2026 3:04 UTC (Fri) by intelfx (subscriber, #130118) [Link] (1 responses)

The way I learnt it

You learnt wrong.

the word is an acronym for “[AI] synthesised lies

Fair enough so far. Lies are not a good thing, synthesized or not.

plagiarism

What is "plagiarism"? We are not submitting to a journal of sciences, do we? We don't have plagiarism here, this is not a term that exists in our context.

and therefore applicable to everything regurgitated from an LLM.

I don't know, when I ask a local LLM to figure out this file format and I receive an ImHex pattern dissecting it in return, I don't think the label of a "lie" is applicable to it. It dissects the file, doesn't it? Neither it is "plagiarism", as per above. Therefore your conclusion is invalid, sorry.

I don’t understand that Clevis/Tang setup

Posted Sep 25, 2026 4:10 UTC (Fri) by mirabilos (subscriber, #84359) [Link]

No.

Hmmh.

Of course we do have plagiarism outside of academia.

Provenance is important.

“It dissects the file, doesn't it?” is wrong in two regards:

First off, no. The algorithm merely computes a plausible continuation of the prompt. No more, no less.

Second, there is no “it” that could “dissect” as an active verb. Don’t anthropomorphise the fashtech.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 18:42 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

I overengineer my homelab, so I added a simple single-function RP2040-based server. It has its own small backup battery, good enough for a few days. It uses an accelerometer to detect any movement and resets if anything is abnormal. And it doesn't store the private key in flash, so I need to upload it manually after every reboot.

The idea here is that it doesn't need to be rebooted too often.

I don’t understand that Clevis/Tang setup

Posted Sep 17, 2026 8:36 UTC (Thu) by farnz (subscriber, #17727) [Link]

As an example, used at my workplace, the switch ports Clevis protected devices connect to are configured so that the MAC address of the protected device that's supposed to connect to that port goes to a different VLAN, which is the only VLAN that can talk to the Tang server. Other switch ports don't have this special configuration. We then have something set up (I don't know the details) so that if any device on another VLAN tries to talk to the Tang server, IT get an alert.

The result is hassle for IT whenever a protected device moves to a new switch port (but they get alerts to tell them it's happening), and devices that become useless if moved to the wrong switch port, let alone removed from the building.

Comparison with Mandos?

Posted Sep 17, 2026 13:56 UTC (Thu) by geert (subscriber, #98403) [Link]

Recently I learned about https://www.recompile.se/mandos
Has anyone done a comparison between Mandos and Clevis/Tang?

fscrypt != eCryptfs

Posted Sep 17, 2026 20:37 UTC (Thu) by ssmith32 (subscriber, #72404) [Link] (1 responses)

He claims fscrypt does the *exact* same thing. It does not.

In my use case, eCryptfs remains encrypted after boot, and can only be decrypted with a separate password. This is a useful way of securing items that are used rarely, but are valuable (e.g. some passowrds), on a machine that is left on the vast majority of the time. In my case, that's a desktop, but it would seem to be a use case that pops up on home servers.

Maybe the lock/unlock feature plus some weird protector setup that requires a passphrase to be typed in on every unlock is possible, but from the docs, it's not even clear if "locked" means "encrypted", let alone whether a separate passphrase can be required on unlock. It does not seem doable, at least with any ease. At the very least, they should document what "lock" means.

gocryptfs seems like a much more sensible replacement to recommend for someone using eCryptfs.

Also, fair warning, the summary of the talk was excellent, and the information appreciated. But if you go to the linked blog - which contains some useful info - just be ready.

It's created in the sarcastic ass style endemic to the security world. Per the site, apparently, if I disagree, I'm just a cattle and all the opinions belong to my mom? OK. It also seems to push certain solutions as the one way, without highlighting things like gocryptfs. Par for the course in the security world, not that bad, but a little exhausting to sift through if you're tired and just looking for help.

fscrypt != eCryptfs

Posted Sep 19, 2026 21:07 UTC (Sat) by mbunkus (subscriber, #87248) [Link]

Can confirm: I'm one of those who've gone from ecryptfs to gocryptfs. Works exactly as before, performs very well.


Copyright © 2026, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds