My laptop isn't under my supervision most of the time. And I'd hate it if someone were to steal my SSD, or whole laptop even, when I'm not around. Is there a way to encrypt everything, but still keep the device in sleep, and unclock it without much delay. It's a very slow laptop. So decryption on login isn't viable, takes too long. While booting up also takes forever, so it needs to be in a "safe" state when simply logged out. Maybe a way that's decrypt-on-demand?
The standard route is to decrypt on boot. It happens after GRUB but before your display manager starts. IDK if there even is a setup that has you "decrypt on login". Thats sounds like your display manager (sddm for KDE) is decrypting system which is not possible IMO.
Unless your laptop somehow has multiple drives you'll want to use the "LVM on LUKS" configuration. 1 small partition for /boot. The rest gets LUKS encrypted, and an LVM group is put on the LUKS container. Or you could replace LVM with btrfs.
This will require wiping your system and reinstalling so you have some reading to do.
The arch-install script in the live iso has options for full disk encryption.
If you suspend to RAM your system will stay unencrypted, because your ram is not encrypted. if you suspend to disk (aka hibernate) your system will be encrypted. You go through the boot loader when waking from hibernation but it just drops you off where you left off.
You need a swapfile for hibernation so make sure its inside the LUKS container.
Looks like they use eCryptFS. Never heard of it before so thats neat. I can see using it on systems where you can't reinstall the system with Dm-crypt but it most cases I suspect Dm-crypt is a better alternative.
To add to the comments, most distros do not offer FDE by default when installing. You have to jump thru hoops. No idea why this is still the case given how many consumer computers are laptops these days, it seems crazy.
The big exception seems to be PopOS, an Ubuntu derivative which is intended for laptops. FDE by default so it must be pretty easy to get that up and running.
Ubuntu itself has a solid FDE option on install, too. It sets up the LVM configuration as already described, no expertise needed. And IME works very reliably.
openSUSE also has a simple FDE setup. Just check a box and enter a passphrase during install. It's not default, but it's about as easy as possible to set up.
I'm pretty sure all the major distros have FDE as an option in the installer its just never on by default. Fedora does the same but with BTRFS on LUKS. I'm sure Debian does. Someone else says OpenSuse does. Maybe some derivative distros don't but I suspect the ones with an graphical installer do.
Keep in mind an unencrypted /boot partition still leaves you open to an evil maid attack. I'm not really paranoid (or interesting) enough that I feel the need to take measures to prevent those kinds of attacks, but your situation may differ.
Dreams of Code on YouTube has a video for a full start to finish arch install specifically including full disk encryption. While my computer is far from “slow” it’s also nothing crazy, and other than adding a second password to my bootup process, the decrypting really doesn’t take long.
How old are we talking? If the CPU is >10 years old and/or some kind of ARM, it may not have hardware encryption acceleration, which means it'll happen in software. I did that once, it was horrible. lscpu |grep -i aes should probably tell you what you need to know.
If you don't have hardware encryption you can use --cipher xchacha20,aes-adiantum option when running cryptsetup to make it way faster than standard aes cipher in software.
That's not a slow laptop. I've been daily driving worse for years.
To protect the data from random thief just browsing through the files I still use ecryptfs. It only encrypts the home directory, and the keys are derived from my accounts password, so no extra hassle.
The encryption is weak by the current standards, and wouldn't stop a determined attacker, but it's 100% better than nothing, and I've never noticed any performance problems.
That is absolutely not a slow laptop. If it takes a long time to boot there must be something wrong. I have a similar system that takes about ten seconds to boot.
Anyways, like others said, LVM with LUKS is the simplest. It uses your hardware to quickly decrypt the drive on boot. While it is running access to your data is protected by your login manager or lock screen.
That's pretty much my ThinkPad's Specs. Fine for almost all stuff I have to do on the go (expect CAD, don't try to run BricsCAD on the thing, it'll make you go crazy.)
I use full disk encryption on it, as on all my other devices, and it's fine, speed-wise. The SSD is NVME, not SATA, but I doubt the performance impact would be noticeable on a SATA SSD if that's what you've got.
Yeah im thinking do “normal” decrypt on boot. It’ll be easier to troubleshoot and recover from if something goes wrong and there’s fewer pitfalls to deal with.
I also suspect that theres a problem with your computer because boot times have been pretty fast for many years now.
E: I just now saw that you’re using an eighth generation intel processor, plenty of ram and an ssd.
I have the same situation but a much older processor and my boot times from button press to desktop are ~10 seconds.
Unless your expectations for boot times are way out of line, you ought to have no problem using decrypt on boot.
One possibility is that your ssd has aged and is having to read those old system file blocks hundreds of times to get it right. Badblocks -n or spinrite level 2 or 3 scan fixes this problem.
I encrypt my disk with LVM on my Debian laptop. You'll need to reinstall your operating system, as you have to do special partitioning. If your device has a TPM, you can use Clevis to set it to auto-decrypt.
Maybe systemd-homed is the solution you are looking for. The arch wiki has a page for it. And this can be better for your use case because only your home folder needs decryption and not the whole drive.
And they also have a guide on migrating a traditional user home to this. Do remember to take backups if going this route
https://systemd.io/CONVERTING_TO_HOMED/
Most filesystems now how encryption that is better optimized for their specific performance & might be worth choosing over LUKS… ZFS, Bcachefs, F2FS, ext4
With an encrypted disk, you only need to enter the encryption password when you shutdown or restart. Suspending and sleep lock screen don't need your encryption password.
That's true for hibernation, but not suspending. Hibernation stores everything in RAM onto the disk then shuts off the PC; to resume the system, you need to unlock the disk to access that data. Suspending doesn't turn off the computer, it keeps the CPU and RAM active.
On my Fedora system, I can hit the suspend button and get back into the OS without needing to type my encryption password, only my user password.
I use ZFS on my workstations with Debian, but yeah full drive is the way to go i think even Linux Mint does full drive anymore, also remember to keep backups.
Encrypting and decrypting are complex operations that requires a lot from the hardware. The resources needed to encrypt and decrypt is proportionally correlated with the amount of files you're encrypting and decrypting.
That said, there are some alternatives
Encrypt the whole filesystem
Encrypt only your home folder
Encrypt only the files you wanna
There is an app, Vaults, that allows you to create vaults to easily encrypt and decrypt folders. Take a look on this app
Detectors say that you are human, you use multiple languages, and you are a moderator, but it feels like a 101 AI response. It's horrible that we're living in an era where you need to be careful about this. You were probably trying to format it nice, but I've only read this phrasing from AI.
But thanks for the answer, the home folder would probably be best. I don't want to think about it after setting it up. All my downloads and docs are there. I also feel like the whole filesystem would take forever for me to unlock/boot.
Are the detectors part for real or were you just kidding? 😲
You were probably trying to format it nice, but I've only read this phrasing from AI.
Yes, I was, because I like to put my text well formated... I feel pain when I have to read bad formated texts, so I try to be as clean as possible
But thanks for the answer, the home folder would probably be best. I don't want to think about it after setting it up. All my downloads and docs are there. I also feel like the whole filesystem would take forever for me to unlock/boot.
For home folder I think there is a better alternative, like systemd-homed or something like that