Outils pour utilisateurs

Outils du site


tech:notes_gostcrypt

Ceci est une ancienne révision du document !


Gostcrypt

Voir :

Voir aussi :

  • VeraCrypt (anciennement TrueCrypt)
  • Cryptsetup - luks
  • wipefs

Installation

wget "https://www.gostcrypt.org/download/1.0/linux/Gostcrypt_1.0.deb"
sha256sum Gostcrypt_1.0.deb
dpkg -i Gostcrypt_1.0.deb
apt-get -f install

config du sudoers Normalement pas nécessaire, sauf pour disque ou partition entière Attention a ne pas autoriser n'importe qui !
Car droit de détruire le système de fichier

visudo -f /etc/sudoers.d/gostcrypt
/etc/sudoers.d/gostcrypt
jean       ALL=(root) NOPASSWD: /usr/bin/gostcrypt

Test

gostcrypt --test

Pour une utilisation en ligne de commande sans sortie sur le serveur X

unset DISPLAY

Création d'un clef

gostcrypt --create-keyfile key < /dev/urandom

Pour l'aide

gostcrypt -t --help |less

Création d'un volume en ligne de commande (mode fichier)

gostcrypt -t -k key -c disk --encryption="GOST 28147-89" --hash="GOST R 34.11-2012" -password="" --volume-type=normal --random-source=/dev/urandom --filesystem=none --size=$((100 * 1024 * 1024))

Création d'un volume en ligne de commande (mode disque / partition)

gostcrypt -t -k /home/jean/key -c /dev/sdg --encryption="GOST 28147-89" --hash="GOST R 34.11-2012" -password="" --volume-type=normal --random-source=/dev/urandom --filesystem=none
sudo gostcrypt -t --filesystem=none --protect-hidden=no -password="" -k /home/jean/key /dev/sdb
$ gostcrypt -t -l
1: /home/jean/disk /dev/loop0 -

Vérifions que la taille correspond bien à notre nouveau volume chiffré

fdisk -l /dev/loop0

Formatons !

mkfs.ext4 /dev/loop0

On monte la partition

mount -o noatime /dev/loop0 /mnt/gostcrypt/
df -hP /mnt/gostcrypt/

Quand on a fini

umount /mnt/gostcrypt 
gostcrypt -t -d

Bug

Error: No such file or directory

Solution : Prendre l'ancienne version gostcrypt_debian_7.4_amd64

Liens :

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)

cat monfichierclef |openssl enc -bf -S abcd -out k2 -pass file:k1.txt

L'option -S, c'est le sel (salt), ici abcd. Il doit être en hexadécimal.
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

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é)

find ../plop -not -size 64c -delete

Voilà comment utiliser toutes les clefs pour créer un volume

gostcrypt -t -k $(echo *|tr " " ",") -c ../disk --encryption="GOST 28147-89" --hash="GOST R 34.11-2012" -password="" --volume-type=normal --random-source=/dev/urandom --filesystem=none --size=$((100 * 1024 * 1024)

Pb install

wget https://www.gostcrypt.org/download/1.0/linux/Gostcrypt_1.0.deb
dpkg -i Gostcrypt_1.0.deb
# apt-get -f install
Unpacking libgl1-mesa-dri:amd64 (from .../libgl1-mesa-dri_8.0.5-4+deb7u2_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libgl1-mesa-dri_8.0.5-4+deb7u2_amd64.deb (--unpack):
 trying to overwrite shared '/etc/drirc', which is different from other instances of package libgl1-mesa-dri:amd64
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/libgl1-mesa-dri_8.0.5-4+deb7u2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Si erreur, relancer la commande :

apt-get -f install
tech/notes_gostcrypt.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki