aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-09-19 04:47:43 -0300
committerEuAndreh <eu@euandre.org>2023-09-19 04:47:47 -0300
commit6d3fb5720f45ddd114dad237573e055a303fada5 (patch)
treee63f755b08643b3888e0284d6ec1893717d5a999 /bin
parentetc/nix/configuration.nix: run nixfmt(1) (diff)
downloaddotfiles-6d3fb5720f45ddd114dad237573e055a303fada5.tar.gz
dotfiles-6d3fb5720f45ddd114dad237573e055a303fada5.tar.xz
bin/{uuid,gen-password}: Use /dev/urandom over /dev/random
As Thomas Pornin eloquently put it[0]: > use /dev/urandom and be happy; use /dev/random and be sorry [0]: https://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gen-password2
-rwxr-xr-xbin/uuid4
2 files changed, 3 insertions, 3 deletions
diff --git a/bin/gen-password b/bin/gen-password
index 758845c..244d971 100755
--- a/bin/gen-password
+++ b/bin/gen-password
@@ -69,6 +69,6 @@ shift $((OPTIND - 1))
LENGTH="${1:-999}"
-tr -cd '[:alnum:]' < /dev/random |
+tr -cd '[:alnum:]' < /dev/urandom |
fold -w "$LENGTH" |
head -n1
diff --git a/bin/uuid b/bin/uuid
index bdd0090..7aa1e58 100755
--- a/bin/uuid
+++ b/bin/uuid
@@ -17,7 +17,7 @@ help() {
-h, --help show this message
- Generate UUID from /dev/random.
+ Generate UUID from /dev/urandom.
Examples:
@@ -59,5 +59,5 @@ while getopts 'h' flag; do
done
shift $((OPTIND - 1))
-od -xN20 /dev/random |
+od -xN20 /dev/urandom |
awk 'NR == 1 { OFS="-"; print $2$3,$4,$5,$6,$7$8$9; exit }'