1

In LUKS, only files get encrypted, not the entire drive.

So my question is, what is accessible if just files are encrypted. For example:

Are file paths or file names visible? (Eg: For Enrypted ZIP Files using ZipCrypto i can see full paths, filenames which makes it possible to attack)??

Is there no encryption mechanism for a linux disk that for example encrypts page-by-page or any other mechanism so that you cannot read anything?

3
  • 2
    "In LUKS, only files get encrypted, not the entire drive" - where did you get this from?
    – Panki
    Commented Oct 20, 2023 at 12:19
  • You can infact encrypt the entire drive, and I'm tempted to mark this as a duplicate: unix.stackexchange.com/questions/558481/…
    – Panki
    Commented Oct 20, 2023 at 12:20
  • background: in the past i asked about how dd+gzip is able to shrink my 250gb disk to ~14gb (actual disk usage was maybe 12g) when "luks" encrypts the entire disk. back then i was told LUKS only encrypts files. how else would gzip be able to know what it can throw away? Commented Oct 20, 2023 at 13:40

1 Answer 1

4

In LUKS, only files get encrypted, not the entire drive.

This is wrong. LUKS encrypts the whole volume. LUKS operates at a lower level than the filesystem. It doesn't know anything about files, directories, free space, etc. LUKS encrypts and decrypts blocks. What the filesystem (if any) does with those blocks is its own business.

In a LUKS-encrypted volume (drive or partition), the only thing that is visible in plaintext is a header containing some metadata (choice of encryption algorithm, list of passphrase hashes, volume UUID, …).

Either you read some incorrect information about LUKS or you're confusing it with some other storage encryption mechanism.

Is there no encryption mechanism for a linux disk that for example encrypts page-by-page or any other mechanism so that you cannot read anything?

Yes, there is. It's LUKS.

3
  • background: in the past i asked about how dd+gzip is able to shrink my 250gb disk to ~14gb (actual disk usage was maybe 12g) when "luks" encrypts the entire disk. back then i was told LUKS only encrypts files. how else would gzip be able to know what it can throw away? Commented Oct 20, 2023 at 13:40
  • 1
    @user82375897897928347 Disks are typically sold with most blocks containing 0. LUKS only ever writes encrypted blocks, but if a block has never been encrypted, it still contains 0, so it takes negligible space after compression. If you had filled your disk then deleted some of the content, all blocks would have been written and the disk would only contain encrypted, uncompressible blocks. But if you only used 12GB, and had a typical amount of churn, then it's plausible that ~14GB of blocks had been used at least once and the rest had never been used. Commented Oct 20, 2023 at 14:00
  • ok understandable and understood :) BUT unlikely. back then the disk i used was from a very old system. cannot say for sure of course but unlikely it never used more than this - and i did not clean-wipe it during installation. anyhow, interesting, thanks Commented Oct 20, 2023 at 14:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .