From 6d3fb5720f45ddd114dad237573e055a303fada5 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 19 Sep 2023 04:47:43 -0300 Subject: 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 --- bin/gen-password | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/gen-password') 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 -- cgit v1.2.3