tech:notes_gostcrypt
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_gostcrypt [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:notes_gostcrypt [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Gostcrypt | ||
| + | |||
| + | Voir : | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * VeraCrypt (anciennement TrueCrypt) | ||
| + | * Cryptsetup - luks | ||
| + | * wipefs | ||
| + | |||
| + | |||
| + | Installation | ||
| + | ~~~bash | ||
| + | wget " | ||
| + | sha256sum Gostcrypt_1.0.deb | ||
| + | dpkg -i Gostcrypt_1.0.deb | ||
| + | apt-get -f install | ||
| + | ~~~ | ||
| + | |||
| + | config du sudoers | ||
| + | Normalement pas nécessaire, | ||
| + | ** Attention a ne pas autoriser n' | ||
| + | ~~~bash | ||
| + | visudo -f / | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | jean | ||
| + | ~~~ | ||
| + | |||
| + | Test | ||
| + | ~~~bash | ||
| + | gostcrypt --test | ||
| + | ~~~ | ||
| + | |||
| + | Pour une utilisation en ligne de commande sans sortie sur le serveur X | ||
| + | ~~~bash | ||
| + | unset DISPLAY | ||
| + | ~~~ | ||
| + | |||
| + | Création d'un clef | ||
| + | ~~~bash | ||
| + | gostcrypt --create-keyfile key < / | ||
| + | ~~~ | ||
| + | |||
| + | Pour l'aide | ||
| + | ~~~bash | ||
| + | gostcrypt -t --help | less | ||
| + | ~~~ | ||
| + | |||
| + | Création d'un volume en ligne de commande (mode fichier) | ||
| + | ~~~bash | ||
| + | gostcrypt -t -k key -c disk --encryption=" | ||
| + | ~~~ | ||
| + | |||
| + | Création d'un volume en ligne de commande (mode disque / partition) | ||
| + | ~~~bash | ||
| + | gostcrypt -t -k / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | sudo gostcrypt -t --filesystem=none --protect-hidden=no -password="" | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | $ gostcrypt -t -l | ||
| + | 1: / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Vérifions que la taille correspond bien à notre nouveau volume chiffré | ||
| + | ~~~bash | ||
| + | fdisk -l /dev/loop0 | ||
| + | ~~~ | ||
| + | |||
| + | Formatons ! | ||
| + | ~~~bash | ||
| + | mkfs.ext4 /dev/loop0 | ||
| + | ~~~ | ||
| + | |||
| + | On monte la partition | ||
| + | ~~~bash | ||
| + | mount -o noatime /dev/loop0 / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | df -hP / | ||
| + | ~~~ | ||
| + | |||
| + | ## Quand on a fini | ||
| + | |||
| + | ~~~bash | ||
| + | umount / | ||
| + | gostcrypt -t -d | ||
| + | ~~~ | ||
| + | |||
| + | ## Bug | ||
| + | |||
| + | ~~~ | ||
| + | Error: No such file or directory | ||
| + | ~~~ | ||
| + | |||
| + | Solution : | ||
| + | Prendre l' | ||
| + | |||
| + | Liens : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | ## Accroire la sécurité en utilisant plusieurs clefs | ||
| + | |||
| + | La taille fixe de clef, limité à 64 octets n'est pas une limite. | ||
| + | |||
| + | Ici nous allons utiliser un gros fichier (monfichierclef) que nous allons chiffrer avec une petite sous-clef (k1.txt). Tout cela pour créer une nouvelle clef (k2) | ||
| + | |||
| + | ~~~bash | ||
| + | cat monfichierclef | openssl enc -bf -S abcd -out k2 -pass file:k1.txt | ||
| + | ~~~ | ||
| + | |||
| + | L' | ||
| + | Sans cela la commande openssl, créerai à chaque fois un fichier **k2** différant | ||
| + | |||
| + | Les clefs doivent obligatoirement faire une taille de 64 octets, découpons **k2** en plusieurs petites clefs | ||
| + | ~~~bash | ||
| + | mkdir plop | ||
| + | cd plop | ||
| + | split -b 64 ../k2 | ||
| + | ~~~ | ||
| + | |||
| + | Nous effaçons le seul fichier qui ne fait pas exactement 64 octets, c'est à dire le dernier généré (tronqué) | ||
| + | ~~~bash | ||
| + | find ../plop -not -size 64c -delete | ||
| + | ~~~ | ||
| + | |||
| + | Voilà comment utiliser toutes les clefs pour créer un volume | ||
| + | ~~~bash | ||
| + | gostcrypt -t -k $(echo *| tr " " "," | ||
| + | ~~~ | ||
| + | |||
| + | ## Pb install | ||
| + | |||
| + | ~~~bash | ||
| + | wget https:// | ||
| + | dpkg -i Gostcrypt_1.0.deb | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | # apt-get -f install | ||
| + | Unpacking libgl1-mesa-dri: | ||
| + | dpkg: error processing / | ||
| + | | ||
| + | Processing triggers for man-db ... | ||
| + | Errors were encountered while processing: | ||
| + | / | ||
| + | E: Sub-process / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Si erreur, relancer la commande : | ||
| + | ~~~bash | ||
| + | apt-get -f install | ||
| + | ~~~ | ||
| + | |||
| + | |||
