Outils pour utilisateurs

Outils du site


tech:generer_un_mot_de_passe

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
tech:generer_un_mot_de_passe [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:generer_un_mot_de_passe [2025/07/21 14:32] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 {{tag>Mdp Random}} {{tag>Mdp Random}}
  
-Générer un mot de passe+Générer un mot de passe
  
 Un bon mot de passe contient : majuscule, minuscule, trait d'union, nombre premier, haïku, hiéroglyphe, symbole astrologique, et le sang d'une vierge. Un bon mot de passe contient : majuscule, minuscule, trait d'union, nombre premier, haïku, hiéroglyphe, symbole astrologique, et le sang d'une vierge.
Ligne 7: Ligne 8:
 Keepassx / Keepass propose un générateur de mot de passe. Keepassx / Keepass propose un générateur de mot de passe.
  
-Générer un mot de passe vous-même : [[https://www.geekarea.fr/wordpress/?p=226|Gérer ses mots de passe]]+Générer un mot de passe vous-même : [Gérer ses mots de passe](https://www.geekarea.fr/wordpress/?p=226)
  
 Sinon :  Sinon : 
-<code bash>+~~~bash
 dd if=/dev/random bs=1 count=75 2>/dev/null | base64 dd if=/dev/random bs=1 count=75 2>/dev/null | base64
-</code>+~~~
  
 ou ou
  
-<code bash>+~~~bash
 cat /dev/urandom  |tr -dc A-Za-z0-9 |head -c10 cat /dev/urandom  |tr -dc A-Za-z0-9 |head -c10
-</code>+~~~
  
 Pour un code décimal  Pour un code décimal 
-<code bash>+~~~bash
 echo $RANDOM$RANDOM echo $RANDOM$RANDOM
-</code>+~~~
  
 Aléatoirement A ou B Aléatoirement A ou B
-<code bash>+~~~bash
 r=(A B) r=(A B)
 echo ${r[RANDOM%2]} echo ${r[RANDOM%2]}
-</code>+~~~
  
 Avec pwgen Avec pwgen
  
-<code bash>+~~~bash
 pwgen -Bs1 16 pwgen -Bs1 16
 pwgen -y1 16 pwgen -y1 16
-</code>+~~~
  
  
 Avec OpenSSL Avec OpenSSL
-<code bash>+~~~bash
 openssl rand -hex 10 openssl rand -hex 10
 openssl rand -base64 16 | sed -e "y/\\/+/\$_/" -e "s/=//g" openssl rand -base64 16 | sed -e "y/\\/+/\$_/" -e "s/=//g"
 openssl rand 300 |perl -pe 's/[^[:ascii:]]|[[:space:]]|\"//g' |tr -d "'\{}\n" openssl rand 300 |perl -pe 's/[^[:ascii:]]|[[:space:]]|\"//g' |tr -d "'\{}\n"
-</code>+~~~
  
 Avec apg Avec apg
-<code bash>+~~~bash
 apg -q -a  0 -n 1 -m 12 -M NCL apg -q -a  0 -n 1 -m 12 -M NCL
 apg -a 1 -m 32 -n 1 -M NCL apg -a 1 -m 32 -n 1 -M NCL
-</code>+~~~
  
 Avec GPG Avec GPG
-<code bash>+~~~bash
 gpg --gen-random --armor 0 24 gpg --gen-random --armor 0 24
-</code>+~~~
  
 Avec Ansible \\ Avec Ansible \\
Ligne 63: Ligne 64:
  
 Hash md5 Hash md5
-<code bash>+~~~bash
 mkpasswd --hash=md5 $PASS mkpasswd --hash=md5 $PASS
-</code>+~~~
  
 Hash SHA-512 (''$6$'' defaut GNU/Linux /etc/shadow) Hash SHA-512 (''$6$'' defaut GNU/Linux /etc/shadow)
-<code bash>+~~~bash
 mkpasswd --method=sha-512 mkpasswd --method=sha-512
-</code>+~~~
  
-<code bash>+~~~bash
 openssl passwd -6 -salt MySaltPlop openssl passwd -6 -salt MySaltPlop
 openssl passwd -6 <(echo 'P@ssw0rd') openssl passwd -6 <(echo 'P@ssw0rd')
-</code>+~~~
  
-<code ->+~~~
 $ man crypt $ man crypt
               ID  | Method               ID  | Method
Ligne 86: Ligne 87:
               5   | SHA-256 (since glibc 2.7)               5   | SHA-256 (since glibc 2.7)
               6   | SHA-512 (since glibc 2.7)               6   | SHA-512 (since glibc 2.7)
-</code>+~~~
  
  
-== Autres 
  
 +## Autres
  
- +~~~bash
- +
-== Autres +
- +
-<code bash>+
 /usr/sbin/rngd -f --fill-watermark=0 -x pkcs11 -x nist /usr/sbin/rngd -f --fill-watermark=0 -x pkcs11 -x nist
-</code>+~~~
  
-== Entropie /dev/urandom+## Entropie /dev/urandom
  
  
Ligne 112: Ligne 109:
  
 Voir :  Voir : 
-* [[https://wiki.debian.org/BoottimeEntropyStarvation|BoottimeEntropyStarvation]]+* [BoottimeEntropyStarvation](https://wiki.debian.org/BoottimeEntropyStarvation
 +* https://linuxfr.org/news/cryptographie-embarquee-briques-de-base-et-communication-avec-serialguard#toc-g%C3%A9n%C3%A9rateur-dal%C3%A9atoire
 * https://www.deltasight.fr/entropie-linux-generation-nombres-aleatoires/ * https://www.deltasight.fr/entropie-linux-generation-nombres-aleatoires/
 * https://wiki.openstack.org/wiki/LibvirtVirtioRng * https://wiki.openstack.org/wiki/LibvirtVirtioRng
Ligne 123: Ligne 121:
  
 Voir one-rng Voir one-rng
-* [[https://onerng.info/|one-rng]]+* [one-rng](https://onerng.info/)
 * https://github.com/drduh/YubiKey-Guide * https://github.com/drduh/YubiKey-Guide
  
Ligne 132: Ligne 130:
  
 Check the available entropy Check the available entropy
-<code bash>+~~~bash
 cat /proc/sys/kernel/random/entropy_avail cat /proc/sys/kernel/random/entropy_avail
-</code>+~~~
  
-==== rngd - rng-tools+ 
 +#### rngd - rng-tools
  
 Sur RedHat Sur RedHat
-<code bash>+~~~bash
 yum install rng-tools yum install rng-tools
 systemctl enable --now rngd systemctl enable --now rngd
-</code>+~~~
  
-<code ->+~~~
 # systemctl status rngd # systemctl status rngd
 ● rngd.service - Hardware RNG Entropy Gatherer Daemon ● rngd.service - Hardware RNG Entropy Gatherer Daemon
Ligne 154: Ligne 153:
    CGroup: /system.slice/rngd.service    CGroup: /system.slice/rngd.service
            └─1170 /usr/sbin/rngd -f --fill-watermark=0 -x pkcs11 -x nist -x qrypt -D daemon:daemon            └─1170 /usr/sbin/rngd -f --fill-watermark=0 -x pkcs11 -x nist -x qrypt -D daemon:daemon
-</code>+~~~ 
  
-=== Non-preferred method: seed randomness source from non-blocking source+### Non-preferred method: seed randomness source from non-blocking source
  
 source : https://access.redhat.com/solutions/19866 source : https://access.redhat.com/solutions/19866
Ligne 165: Ligne 165:
 You can see the entropy value using the following command: You can see the entropy value using the following command:
 Raw Raw
-<code bash>+~~~bash
 cat /proc/sys/kernel/random/entropy_avail cat /proc/sys/kernel/random/entropy_avail
-</code>+~~~
  
 Now, start the rngd daemon using following command and monitor the entropy on the system: Now, start the rngd daemon using following command and monitor the entropy on the system:
 Raw Raw
-<code bash>+~~~bash
 rngd -r /dev/urandom -o /dev/random rngd -r /dev/urandom -o /dev/random
 watch -n 1 cat /proc/sys/kernel/random/entropy_avail watch -n 1 cat /proc/sys/kernel/random/entropy_avail
-</code>+~~~
  
 NOTE: Seeding /dev/random with data derived from /dev/urandom plays a trick on the system - the entropy_avail reported will increase, but the real entropy is actually decreasing. A software-only random number generator like rngd is not a proper substitute for a good hardware random number generator. Do not use rngd in this fashion unless you understand and accept this difference. NOTE: Seeding /dev/random with data derived from /dev/urandom plays a trick on the system - the entropy_avail reported will increase, but the real entropy is actually decreasing. A software-only random number generator like rngd is not a proper substitute for a good hardware random number generator. Do not use rngd in this fashion unless you understand and accept this difference.
  
-=== Autres +### Autres 
  
 Voir  Voir 
Ligne 189: Ligne 189:
 If you run the following, you will may see that available entropy is very low (< 128) and thus reading from /dev/random is likely to block. If you run the following, you will may see that available entropy is very low (< 128) and thus reading from /dev/random is likely to block.
 Raw Raw
-<code bash>+~~~bash
 while sleep 1; do cat /proc/sys/kernel/random/entropy_avail ; done while sleep 1; do cat /proc/sys/kernel/random/entropy_avail ; done
-</code>+~~~
 You can set this temporarily to 1024 (default is 64) You can set this temporarily to 1024 (default is 64)
 Raw Raw
-<code bash>+~~~bash
 echo 1024 > /proc/sys/kernel/random/read_wakeup_threshold echo 1024 > /proc/sys/kernel/random/read_wakeup_threshold
-</code>+~~~
  
  
-=== Test+### Test
  
 An entropy source can be tested for (FIPS-compliant) randomness using the rng-tools or rng-utils. An entropy source can be tested for (FIPS-compliant) randomness using the rng-tools or rng-utils.
  
-<code bash>+~~~bash
 rngtest -c 1000 </dev/random rngtest -c 1000 </dev/random
-</code>+~~~
 Voir https://en.wikipedia.org/wiki/FIPS_140-2 Voir https://en.wikipedia.org/wiki/FIPS_140-2
  
  
-=== TRNG+### TRNG
  
 scdrand   scdrand  
Ligne 218: Ligne 218:
  
  
-=== Pb boot+### Pb boot
  
-<code ->+~~~
 [    1.616819] random: fast init done [    1.616819] random: fast init done
 [    2.299314] random: crng init done [    2.299314] random: crng init done
-</code>+~~~
  
 Kernel boot parameter Kernel boot parameter
-<code ini>+~~~ini
 random.trust_cpu=on random.trust_cpu=on
-</code>+~~~
  
 Voir https://daniel-lange.com/archives/152-hello-buster.html Voir https://daniel-lange.com/archives/152-hello-buster.html
  
-== Infinite Noise TRNG+## Infinite Noise TRNG
  
 Voir : Voir :
 * http://leetronics.de/infnoise * http://leetronics.de/infnoise
  
-<code bash>+~~~bash
 apt-get install infnoise apt-get install infnoise
-</code>+~~~
  
-<code ->+~~~
 # #infnoise --raw --debug > /dev/null  # #infnoise --raw --debug > /dev/null 
 # infnoise --debug --no-output # infnoise --debug --no-output
Ligne 250: Ligne 250:
 Generated 3145728 bits.  OK to use data.  Estimated entropy per bit: 0.872259, estimated K: 1.830528 Generated 3145728 bits.  OK to use data.  Estimated entropy per bit: 0.872259, estimated K: 1.830528
 num1s:50.800612%, even misfires:0.197788%, odd misfires:0.170402% num1s:50.800612%, even misfires:0.197788%, odd misfires:0.170402%
-</code>+~~~
  
  
-<code ->+~~~
 # systemctl status infnoise # systemctl status infnoise
 ● infnoise.service - Wayward Geek InfNoise TRNG driver ● infnoise.service - Wayward Geek InfNoise TRNG driver
Ligne 269: Ligne 269:
 Jul 24 20:23:18 vivobela systemd[1]: Starting infnoise.service - Wayward Geek InfNoise TRNG driver... Jul 24 20:23:18 vivobela systemd[1]: Starting infnoise.service - Wayward Geek InfNoise TRNG driver...
 Jul 24 20:23:18 vivobela systemd[1]: Started infnoise.service - Wayward Geek InfNoise TRNG driver. Jul 24 20:23:18 vivobela systemd[1]: Started infnoise.service - Wayward Geek InfNoise TRNG driver.
-</code>+~~~
  
  
-<code bash>+~~~bash
 systemctl status dev-infnoise.device systemctl status dev-infnoise.device
-</code>+~~~
  
  
tech/generer_un_mot_de_passe.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki