Kryptografie Festplattenverschlüsselung mit LUKS unter Linux

alex's picture

Um eine Festplatte mit LUKS zu verschlüsseln, wird das Paket cryptsetup benötigt, welches mit jeder modernen Linux-Distribution verfügbar sein sollte.

Im folgenden Beispiel ist die zu verschlüsselnde Festplattenpartition /dev/sde3. Diese Angabe musst Du Deiner Konfiguration anpassen. Vorsicht, alle Daten auf dieser Partition gehen verloren!

Vorbereitung

Die bisherigen Daten mit shred vernichten, damit sie nicht mehr wiederherstellbar sind:

shred /dev/sde3

Partition als LUKS Partition einrichten

Wir initialisieren nun die Partition für den Einsatz von LUKS mit der Verschlüsselungstiefe 256bit, also -s 256 und den Chiffriermodus AES und LRW-BENBI. Hier muss nun das Kennwort angegeben werden, welches auch beim Einbinden der Partition eingegeben werden muss. Wichtig ist, dass man hier ein starkes Kennwort verwendet, da das Kennwort eine Schwachstelle für die Verschlüsselung darstellt.

cryptsetup -c aes-lrw-benbi:sha256 -y -s 384 luksFormat /dev/sde3

Blockdevice freigeben

Um ein Dateisystem erstellen zu können muss nun der Device-Mapper-Blockdevice geöffnet werden. Im Beispiel wird der Name "space" verwendet.

cryptsetup luksOpen /dev/sde3 space

Our recommendation

Image of Computer-Forensik: Computerstraftaten erkennen, ermitteln, aufklären
Author: Alexander Geschonneck
Publisher: dpunkt Verlag
The following book contains more information about the current topic. In case you want to know more about Computer-Forensik: Computerstraftaten erkennen, ermitteln, aufklären read this book.

Partition formatieren

Nachdem die Partition als LUKS Partition eingerichtet wurde, muss nun ein Dateisystem auf diese Partition gebunden werden. Mit folgender Anweisung erzeugt man ein EXT3 Dateisystem:

mke2fs -j /dev/mapper/space

Partition einbinden

Die Partition kann nun über den Device-Mapper eingehängt werden (und nicht über das eigentliche Device).

mount /dev/mapper/space /media/space

Disclaimer

While every precaution has been taken in the preperation of this documentation, the authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information herein. If you are a beginner or not sure how to handle something, contact a service professional to give you a hand.
The article may list links to other sites on the Internet, on whose design and contents the site operator does not have any influence. We distance ourselves therefore explicitly from the contents of the linked sites. If we are notified that a linked site violates the applicable law we will remove the link(s) in question immediately. We request to be informed of such links by email should the situation arise.

For our services, contact us. © Copyright, squatlabs - all rights reserved.