[Image description:
Screenshot of terminal output:

~ ❯ lsblk
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda              8:0    1  62.5M  0 disk  
└─topLuks      254:2    0  60.5M  0 crypt 
  └─bottomLuks 254:3    0  44.5M  0 crypt

/end image description]

I had no idea!

If anyone else is curious, it’s pretty much what you would expect:

cryptsetup -y -v luksFormat /dev/sda
cryptsetup open /dev/sda topLuks
cryptsetup -y -v luksFormat /dev/mapper/topLuks
cryptsetup open /dev/mapper/topLuks bottomLuks
lsblk

Then you can make a filesystem and mount it:

mkfs.ext4 /dev/mapper/bottomLuks
mount /dev/mapper/bottomLuks ~/mnt/embeddedLuksTest

I’ve tested putting files on it and then unmounting & re-encrypting it, and the files are indeed still there upon decrypting and re-mounting.

Again, sorry if this is not news to anyone else, but I didn’t realise this was possible before, and thought it was very cool when I found it out. Sharing in case other people didn’t know and also find it cool :)

  • auth
    link
    fedilink
    arrow-up
    4
    ·
    9 months ago

    agreed that it is useless for most cases but I could see it being useful if you need multiple people to agree on decrypting a file.

      • auth
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        9 months ago

        that’s another way, I guess… if you want to split the file, that is

        • cbarrick@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          9 months ago

          No, you don’t split the file. You split the master decryption key.

          Each user just needs to remember their own password, and SSS can reconstruct the master key when enough users enter their passwords.

    • Killing_Spark@feddit.de
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      That’s pretty nitty although you can always just partition a long key and distribute the partitions to the different people

      • auth
        link
        fedilink
        arrow-up
        4
        ·
        9 months ago

        there’s always more than one way to skin a rat