X-Git-Url: http://git.scottworley.com/overonion/blobdiff_plain/d778dfea549bb736863c6b24b6fd1950577b0a5c..636e3e5b935d67b52989f948d80fb151e330f21c:/overonion-make-key diff --git a/overonion-make-key b/overonion-make-key index b909d97..6cfc349 100755 --- a/overonion-make-key +++ b/overonion-make-key @@ -17,6 +17,12 @@ ciphers=( umask 077 +random_source="/dev/random" +if [[ "$1" == '--make_INSECURE_key' ]];then + shift + random_source="/dev/urandom" +fi + if (( $# != 1));then echo "usage: overonion-make-key keyfile" exit 1 @@ -30,6 +36,6 @@ fi i=0 while read -r cipher;do echo -n $'\r'"Generating key $((++i))/${#ciphers[*]}" - cat >> "$keyfile" <<< "$cipher $(head -c 99 /dev/random | base64 --wrap=0 )" + cat >> "$keyfile" <<< "$cipher $(head -c 99 "$random_source" | base64 --wrap=0 )" done < <( IFS=$'\n'; shuf <<< "${ciphers[*]}"; ) echo