this post was submitted on 19 Mar 2024
1 points (100.0% liked)

Linux

46778 readers
1491 users here now

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

Related Communities

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

founded 5 years ago
MODERATORS
 

[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 :)

top 8 comments
sorted by: hot top controversial new old
[–] theit8514@lemmy.world 0 points 5 months ago (1 children)

You can, sure, but you probably shouldn't. Encrypting and decrypting consume additional cpu time, and you won't gain much in terms of security.

[–] authed@lemmy.ml 0 points 5 months ago (2 children)

not really if you have a hardware chip that does the encrypt/decrypting

[–] cbarrick@lemmy.world 0 points 5 months ago* (last edited 5 months ago) (1 children)

AES has been accelerated on all Intel CPUs since Broadwell, was common as far back as Sandy Bridge, and has been available since Westmere.

AMD has had AES acceleration since Bulldozer.

But the commenter is right that adding a second layer of encryption is useless in everything except very specific circumstances.

[–] authed@lemmy.ml 0 points 5 months ago (1 children)

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.

[–] Killing_Spark@feddit.de 0 points 5 months ago

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

[–] theit8514@lemmy.world 0 points 5 months ago (1 children)

Does cryptsetup/luks do that? I thought that was only software encryption.

[–] crispy_kilt@feddit.de 0 points 5 months ago

It does if the CPU supports it. Otherwise i/o would be stupidly slow, AES is expensive

[–] crispy_kilt@feddit.de 0 points 5 months ago

top / bottom

( ͡° ͜ʖ ͡°)