25 avril 2024

TOMB – Chiffrement de fichiers dans un conteneur

Un petit outil en lignes de commande pour créer et chiffrer des conteneurs sous Linux

Petit plus, on peut stocker sa clé dans une image « Stéganographie ».

La plupart des systèmes fournissent ces outils dans leurs dépôts, par exemple sur Debian/Ubuntu, on peut utiliser « apt install » sur Fedora et CentOS on peut utiliser « yum install » et « pacman » sur Arch.

Source : https://github.com/dyne/Tomb/blob/master/INSTALL.md

Pré-requis avant la compilation de Tomb

Tomb a besoin de quelques programmes pour fonctionner :

sudo apt install zsh file sudo gnupg cryptsetup pinentry-curses mlocate

Installation de Tomb

Pour installer Tomb, téléchargez simplement le fichier source (fichier tar.gz) depuis https://files.dyne.org/tomb et décompressez-la.

cd ~/Téléchargements/
wget https://files.dyne.org/tomb/Tomb-2.9.tar.gz
tar zxvf Tomb-2.9.tar.gz
cd Tomb-2.9/
sudo make install

Utilisation Basique

Une fois installé, on peut procéder à la création d’une tombe, par exemple :

tomb dig -s 10 secrets.tomb       (creuser une tombe de 10MB)
tomb forge -k secrets.tomb.key    (créer une nouvelle clé et définir son mot de passe)
tomb lock  -k secrets.tomb.key secrets.tomb    (formater la tombe,et la verrouiller avec la clé)

Lorsque cela est fait, le tombeau peut être ouvert avec :

tomb open -k secrets.tomb.key secrets.tomb (demandera le mot de passe)

La clé peut également être cachée dans une image, pour être utilisée comme clé plus tard :

tomb bury -k secrets.tomb.key nosferatu.jpg (cacher la clé dans une image jpeg)
tomb open -k nosferatu.jpg secrets.tomb (utiliser l'image jpeg pour ouvrir la tombe)

Les principales commandes :

Commands:

   // Creation:
   dig          create a new empty TOMB file of size -s in MiB
   forge        create a new KEY file and set its password
   lock         installs a lock on a TOMB to use it with KEY

   // Operations on tombs:
   open         open an existing TOMB (-k KEY file or - for stdin)
   index        update the search indexes of tombs
   search       looks for filenames matching text patterns
   list         list of open TOMBs and information on them
   ps           list of running processes inside open TOMBs
   close        close a specific TOMB (or 'all')
   slam         slam a TOMB killing all programs using it
   resize       resize a TOMB to a new size -s (can only grow)

   // Operations on keys:
   passwd       change the password of a KEY (needs old pass)
   setkey       change the KEY locking a TOMB (needs old key and pass)

  Options:

   -s           size of the tomb file when creating/resizing one (in MiB)
   -k           path to the key to be used ('-k -' to read from stdin)
   -n           don't launch the execution hooks found in tomb
   -p           preserve the ownership of all files in tomb
   -o           options passed to commands: open, lock, forge (see man)
   -f           force operation (i.e. even if swap is active)
   -g           use a GnuPG key to encrypt a tomb key
   -r           provide GnuPG recipients (separated by comma)
   -R           provide GnuPG hidden recipients (separated by comma)

   -h           print this help
   -v           print version, license and list of available ciphers
   -q           run quietly without printing informations
   -D           print debugging information at runtime

  For more information on Tomb read the manual: man tomb

Si vous recherchez une solution avec une interface graphique : https://www.veracrypt.fr/en/Home.html