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?

I’m on Arch with KDE.

38 points

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.

permalink
report
reply
10 points

There is a way for just your home folder to be encrypted, Linux Mint has it as an option.

permalink
report
parent
reply
3 points

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.

Idk if its faster or slower than Dm-crypt.

permalink
report
parent
reply
9 points

+1 for LVM on LUKS

permalink
report
parent
reply
3 points

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.

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
1 point

Useful to know, thanks.

For the record, I once had a bad experience with the Debian installer’s version. That is why I will not be trying Debian again. Installation is a moment of vulnerability, when you don’t have ready access to your data, or the network, and this is one extra factor. IMO it really is non-negotiable for a distro to provide a bulletproof installation experience.

permalink
report
parent
reply
0 points

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.

permalink
report
parent
reply
1 point

its just never on by default

Except PopOS, as I understand it. IMO that is a major point in its favor and against its competitors, given the dominance of laptops today. I see no reason why this is still opt-in, rather than opt-out as on mobile OSs.

permalink
report
parent
reply
2 points

You technically could encrypt just your home but that’s not the recommended approach.

permalink
report
parent
reply
2 points

okay I got my homework, I’ll read on these.

permalink
report
parent
reply
6 points
*

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.

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
20 points

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.

permalink
report
reply
5 points

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.

permalink
report
parent
reply
3 points

It does give me a result so I do have “aes”. How can I use it?

We’re talking an Intel i5-8350U. it has 16GBs of ram and 500GB of SSD.

permalink
report
parent
reply
4 points

You said you’re on Arch, you’ll want to go through their docs which are solid: https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system

permalink
report
parent
reply
4 points

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.

permalink
report
parent
reply
1 point

I’m not planning on putting information on my laptop that I don’t have to. Speed for a bit of security sounds good. I’ll look into ecryptfs. And also into boot time, lots of you are screaming at me that it’s a fast laptop. what how

permalink
report
parent
reply
2 points
*

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.

permalink
report
parent
reply
1 point

mine’s m.2 too. I tried systemd-homed, as of now it doesn’t work as it should. Next I’ll try disk/partition one but it’d be great to encrypt when sleeping, it’s fine if it’s hibernation

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
8 points

That’s a hard thing to do for a bunch of reasons. There’s someone else who went into em so I’m not gonna do that.

Unless something’s seriously wrong, it would probably be better to just make your laptop boot faster.

So, what’s your laptop, what kind of disk does it have and how long does it take to boot/login?

permalink
report
reply
1 point

Is your idea to do the easier decrypt on boot, and optimize the boot times?

I could probably do that, but someone else said that there is a decrypt on hibernate, seems better.

permalink
report
parent
reply
3 points
*

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.

permalink
report
parent
reply
1 point

I bought it used, so I’m interested in your last point. I’ve reinstalled it - first thing I did. Do SSDs slow down overtime? And there is a linux command to fix that? Sound crazy, can you elaborate?

permalink
report
parent
reply
8 points

LUKS2 with a strong hash.

It will take a while to decrypt but it will so be worth it. You only have to enter the password once.

permalink
report
reply
5 points

LUKS2

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 9.6K

    Monthly active users

  • 3.2K

    Posts

  • 36K

    Comments