Create pw randomly use binary file source
by tidahot from LinuxQuestions.org on (#6J7X8)
Was thinking of commandline way create pw randomly ussing file as source of chars instead of other random source.
Code:#!/bin/bash
#parm1
sizebyte=$(wc -c < $1)
for ((i = 0 ; i < 7 ; i++)); do
#grab characters random
lines=$((1 + $RANDOM % 5))
position=$((1 + $RANDOM % $sizebyte))
#done
dd skip=$position count=50 if=$1 of=/tmp/out.bin bs=1
final+=$(tr -dc [:graph:] < /tmp/out.bin | head -c $lines)
rm /tmp/out.bin
#debug
final+=" "
done
echo $finalIs seed from a binary file good source method?
Code:#!/bin/bash
#parm1
sizebyte=$(wc -c < $1)
for ((i = 0 ; i < 7 ; i++)); do
#grab characters random
lines=$((1 + $RANDOM % 5))
position=$((1 + $RANDOM % $sizebyte))
#done
dd skip=$position count=50 if=$1 of=/tmp/out.bin bs=1
final+=$(tr -dc [:graph:] < /tmp/out.bin | head -c $lines)
rm /tmp/out.bin
#debug
final+=" "
done
echo $finalIs seed from a binary file good source method?