X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/107b9c5341a52d03350d698b5ec42e26d810a93c..203add48226f4fb9e6dbdde301e70daa15ab1a54:/user/bknpass?ds=inline diff --git a/user/bknpass b/user/bknpass index c1c1d1a..678ab7f 100755 --- a/user/bknpass +++ b/user/bknpass @@ -1,59 +1,32 @@ #!/bin/bash - -# Author: Steven Baltakatei Sandoval (baltakatei.com) -# -# License: This bash script, `bknpass`, is licensed under GPLv3 or -# later by Steven Baltakatei Sandoval: -# -# `bknpass`, an alphanumeric password generator -# Copyright (C) 2021 Steven Baltakatei Sandoval (baltakatei.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# A copy of the GNU General Public License may be found at -# . -# -# Description: This bash script generates alphanumeric passphrases -# with a char-count determined by a user-provided number of bits of -# entropy. The passphrase is then outputted to stdout with a trailing -# newline. It works as follows: +# Desc: Generate alphanumeric passphrase with specified bits of entropy. +# Usage: bknpass [int] +# Example: bknpass 128 +# Depends: bash, echo, bc, awk, tr, head, Debian 10 +# Version: 0.1.0 +# Note: This bash script generates alphanumeric passphrases +# with a char-count determined by a user-provided number of bits of +# entropy. The passphrase is then outputted to stdout with a trailing +# newline. It works as follows: # -# - Prompt user for an integer. This integer is the number of bits -# of entropy that the generated password should have. +# - Prompt user for an integer. This integer is the number of bits +# of entropy that the generated password should have. # -# - Check if user-provided string is an integer using `bash` regular -# expression test. +# - Check if user-provided string is an integer using `bash` regular +# expression test. # -# - Calculate the minimum number of bech32 base32 characters -# required to encode the specified number of bits of entropy. +# - Calculate the minimum number of bech32 base32 characters +# required to encode the specified number of bits of entropy. # -# - This step uses `bc` to calculate a logarithm float string -# and `awk` to convert the float into an integer, rounding up. +# - This step uses `bc` to calculate a logarithm float string +# and `awk` to convert the float into an integer, rounding up. # -# - Use `tr`, `/dev/urandom`, and `head` to generate a random -# alphanumeric string with the length calculated in the previous -# step. +# - Use `tr`, `/dev/urandom`, and `head` to generate a random +# alphanumeric string with the length calculated in the previous +# step. # -# - Use `echo` to display the passphrase in stdout with a trailing -# newline. -# -# Usage: bknpass [int] -# -# Example: bknpass 256 -# -# Dependencies: bash, echo, bc, awk, tr, head. See end of file -# -# Tested on: -# -# - GNU/Linux Debian 10 +# - Use `echo` to display the passphrase in stdout with a trailing +# newline. #==Initialization== @@ -209,3 +182,6 @@ echo -e "$PASS1" # There is NO WARRANTY, to the extent permitted by law. # # Written by David MacKenzie and Jim Meyering. + +# Author: Steven Baltakatei Sandoval +# License: GPLv3+