From bfeece461b565dbdc8172b61b063e528e5f9a218 Mon Sep 17 00:00:00 2001 From: drduh Date: Fri, 3 Jul 2015 00:29:12 -0400 Subject: [PATCH] Accurate max password length --- pwd.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pwd.sh b/pwd.sh index 7b80ba5..92e9dd8 100755 --- a/pwd.sh +++ b/pwd.sh @@ -76,13 +76,14 @@ gen_pass () { # Generate a password. len=40 - read -p "Password length? (default: 40, max: 80) " length + read -p "Password length? (default: 40, max: 100) " length if [[ ${length} =~ ^[0-9]+$ ]] ; then len=${length} fi - ${gpg} --gen-random -a 0 80 | cut -c -${len} + # base64: 4 characters for every 3 bytes + ${gpg} --gen-random -a 0 75 | cut -c -${len} }