Ein Wiki privater Natur

Verschlüsseltes Backupdevice erstellen

cryptsetup benchmark
Den schnellsten Algorithmus finden

`
#luks version 2 ist default

dd if=/dev/urandom of=/root/.WD-1TBA bs=512 count=8
fdisk -l /dev/sdg
cryptsetup luksAddKey /dev/sda /root/.WD-1TBA
cryptsetup luksOpen /dev/sdg1 WD-1TBA --key-file=/root/.WD-1TBA
-m 0 # Kein Platz für root reservieren
mkfs.ext4 -L WD-1TBA -m 0 /dev/mapper/WD-1TBA
Da das Device nun bereits offen ist, kann nun mit
mount /dev/mapper/WD-1TBA /mnt
das neue LuksDevice eingebunden werden.

Wenn man später das Laufwerk benutzen möchte, hier die
Reihenfolge: Auf der Console

Grafische Oberfläche:

datenträgeranmeldung_erforderlich.png
Hier das Luks Passwort eingeben.
Arbeiten
Trennen:
bildschirmfoto_vom_2023-10-03_16-09-23.png

Zustand des Luks Devices:
cryptsetup luksDump /dev/sda
LUKS header information
Version:       	2
Epoch:         	4
Metadata area: 	16384 [bytes]
Keyslots area: 	16744448 [bytes]
UUID:          	f9fda242-d790-4780-acb0-73ac9fa88275
Label:         	(no label)
Subsystem:     	(no subsystem)
Flags:       	(no flags)

Data segments:
  0: crypt
	offset: 16777216 [bytes]
	length: (whole device)
	cipher: aes-cbc-essiv:sha256
	sector: 512 [bytes]

Keyslots:
  0: luks2
	Key:        256 bits
	Priority:   normal
	Cipher:     aes-cbc-essiv:sha256
	Cipher key: 256 bits
	PBKDF:      argon2id
	Time cost:  10
	Memory:     1048576
	Threads:    4
	Salt:       ee fe 00 bf dd 8d a6 7e 45 1b 96 02 95 af 23 72 
	            7f 17 ad 11 86 5f 8a fe 47 c0 61 c5 96 48 11 63 
	AF stripes: 4000
	AF hash:    sha256
	Area offset:32768 [bytes]
	Area length:131072 [bytes]
	Digest ID:  0
  1: luks2
	Key:        256 bits
	Priority:   normal
	Cipher:     aes-cbc-essiv:sha256
	Cipher key: 256 bits
	PBKDF:      argon2id
	Time cost:  10
	Memory:     1048576
	Threads:    4
	Salt:       8c 10 94 a2 e4 51 40 e2 d3 e3 64 89 2c dc 25 08 
	            64 fb 21 80 e1 4c ee 39 be 7e 14 28 90 ad dd a3 
	AF stripes: 4000
	AF hash:    sha256
	Area offset:163840 [bytes]
	Area length:131072 [bytes]
	Digest ID:  0
Tokens:
Digests:
  0: pbkdf2
	Hash:       sha256
	Iterations: 345836
	Salt:       56 9a 32 97 85 5f 45 f7 4c 43 92 a9 f8 eb 7c 1b 
	            1a 94 4c 8d d8 6c 2f 08 56 85 34 73 25 a8 fb fd 
	Digest:     e2 b4 c9 a3 2f 58 d2 10 8f 64 c6 67 f2 42 52 c6 
	            1e b7 66 ed 9f 6b ec b2 c8 e8 2f 40 f0 44 7e c8 

Ein Key-file generieren und den Luks Container damit öffnen
cryptsetup luksDump /dev/sda # vorher

dd if=/dev/urandom of=/home/bed/.foobaar bs=512 count=8
cryptsetup luksAddKey /dev/sda /home/bed/.foobaar key-file adden

Jetzt kann das key-file verwendet werden

Nachtrag: luksDump zeigt nun einen Key Slot mehr

LUKS header information
Version:       	2
Epoch:         	5
Metadata area: 	16384 [bytes]
Keyslots area: 	16744448 [bytes]
UUID:          	f9fda242-d790-4780-acb0-73ac9fa88275
Label:         	(no label)
Subsystem:     	(no subsystem)
Flags:       	(no flags)

Data segments:
  0: crypt
	offset: 16777216 [bytes]
	length: (whole device)
	cipher: aes-cbc-essiv:sha256
	sector: 512 [bytes]

Keyslots:
  0: luks2
	Key:        256 bits
	Priority:   normal
	Cipher:     aes-cbc-essiv:sha256
	Cipher key: 256 bits
	PBKDF:      argon2id
	Time cost:  10
	Memory:     1048576
	Threads:    4
	Salt:       ee fe 00 bf dd 8d a6 7e 45 1b 96 02 95 af 23 72 
	            7f 17 ad 11 86 5f 8a fe 47 c0 61 c5 96 48 11 63 
	AF stripes: 4000
	AF hash:    sha256
	Area offset:32768 [bytes]
	Area length:131072 [bytes]
	Digest ID:  0
  1: luks2
	Key:        256 bits
	Priority:   normal
	Cipher:     aes-cbc-essiv:sha256
	Cipher key: 256 bits
	PBKDF:      argon2id
	Time cost:  10
	Memory:     1048576
	Threads:    4
	Salt:       8c 10 94 a2 e4 51 40 e2 d3 e3 64 89 2c dc 25 08 
	            64 fb 21 80 e1 4c ee 39 be 7e 14 28 90 ad dd a3 
	AF stripes: 4000
	AF hash:    sha256
	Area offset:163840 [bytes]
	Area length:131072 [bytes]
	Digest ID:  0
  2: luks2
	Key:        256 bits
	Priority:   normal
	Cipher:     aes-cbc-essiv:sha256
	Cipher key: 256 bits
	PBKDF:      argon2id
	Time cost:  10
	Memory:     1048576
	Threads:    4
	Salt:       62 9a 55 31 68 2d d9 e5 82 38 61 b1 aa 2c f3 8a 
	            1b c3 49 1a e5 49 f7 12 d9 cb d6 43 11 7d 3a 74 
	AF stripes: 4000
	AF hash:    sha256
	Area offset:294912 [bytes]
	Area length:131072 [bytes]
	Digest ID:  0
Tokens:
Digests:
  0: pbkdf2
	Hash:       sha256
	Iterations: 345836
	Salt:       56 9a 32 97 85 5f 45 f7 4c 43 92 a9 f8 eb 7c 1b 
	            1a 94 4c 8d d8 6c 2f 08 56 85 34 73 25 a8 fb fd 
	Digest:     e2 b4 c9 a3 2f 58 d2 10 8f 64 c6 67 f2 42 52 c6 
	            1e b7 66 ed 9f 6b ec b2 c8 e8 2f 40 f0 44 7e c8