3 ms·
I use a Bash Script copied from Stack Overflow: #!/bin/bash choose() { echo ${1:RANDOM%${#1}:1} $RANDOM; } { choose '!@#$%^\&' choose '01234
by VitoVan 8y ago
I use a Bash Script copied from Stack Overflow:
#!/bin/bash
choose() { echo ${1:RANDOM%${#1}:1} $RANDOM; }
{
choose '!@#$%^\&'
choose '0123456789'
choose 'abcdefghijklmnopqrstuvwxyz'
choose 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in $( seq 1 $(( 4 + RANDOM % 8 )) )
do
choose '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
done
} | sort -R | awk '{printf "%s",$1}'
echo ""
https://stackoverflow.com/questions/26665389/random-password-generator-bash/26665585#26665585 https://stackoverflow.com/questions/26665389/random-password...
- minitech 8y agoGenerating passwords with $RANDOM seems like an incredibly bad idea. In bash, it’s a Lehmer RNG seeded with the current microsecond and PID – and the seed is 32 bits. sort -R kind of saves it because it uses /dev/urandom + ISAAC, but it’s really not comfortable – 1/8 of passwords it generates are breakable in at most ~2^29 × 40320 attempts, for example (and the expected number could be much lower than that, I haven’t done the math).
- deleted 8y ago[deleted]
- easytiger 8y agoas opposed to a manually designed password?
- minitech 8y agoDepends on what your strategy for manually designing passwords is (yes, it’s that bad). But anyone who can figure out how to use this bash script can figure out how to use one of the `< /dev/urandom tr` scripts, pwgen, or a password manager.