Appendix E Generating somewhat random passwords

This section documents a library generating random passwords; the library file is libmbfl-passwords.bash. We can load this library at run–time with:

mbfl_load_library(/path/to/libmbfl-passwords.bash)

for details Libraries loading and embedding. Notice that the preprocessor option --print-libmbfl-passwords will print the file pathname of the installed library, Invoking the preprocessor.

Usually we want to use the passwords–generating functions as follows:

{
    mbfl_declare_varref(PASSWD_STRING)
    mbfl_passwords_printable_ascii_noblank mbfl_datavar(PASSWD_STRING) 8
    echo "$PASSWORD_STRING"
}
-| [&W4Yl*t
Function: mbfl_passwords_digits LEN
Function: mbfl_passwords_digits_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_digit().

Function: mbfl_passwords_ascii_symbols LEN
Function: mbfl_passwords_ascii_symbols_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_ascii_symbol().

Function: mbfl_passwords_lower_case_vowels LEN
Function: mbfl_passwords_lower_case_vowels_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_lower_case_vowel().

Function: mbfl_passwords_lower_case_consonants LEN
Function: mbfl_passwords_lower_case_consonants_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_lower_case_consonant().

Function: mbfl_passwords_lower_case_alphabet LEN
Function: mbfl_passwords_lower_case_alphabet_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_lower_case_alphabet().

Function: mbfl_passwords_lower_case_alnum LEN
Function: mbfl_passwords_lower_case_alnum_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_lower_case_alnum().

Function: mbfl_passwords_lower_case_base16 LEN
Function: mbfl_passwords_lower_case_base16_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_lower_case_base16().

Function: mbfl_passwords_upper_case_vowels LEN
Function: mbfl_passwords_upper_case_vowels_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_upper_case_vowel().

Function: mbfl_passwords_upper_case_consonants LEN
Function: mbfl_passwords_upper_case_consonants_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_upper_case_consonant().

Function: mbfl_passwords_upper_case_alphabet LEN
Function: mbfl_passwords_upper_case_alphabet_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_upper_case_alphabet().

Function: mbfl_passwords_upper_case_alnum LEN
Function: mbfl_passwords_upper_case_alnum_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_upper_case_alnum().

Function: mbfl_passwords_upper_case_base16 LEN
Function: mbfl_passwords_upper_case_base16_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_upper_case_base16().

Function: mbfl_passwords_mixed_case_vowels LEN
Function: mbfl_passwords_mixed_case_vowels_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_mixed_case_vowel().

Function: mbfl_passwords_mixed_case_consonants LEN
Function: mbfl_passwords_mixed_case_consonants_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_mixed_case_consonant().

Function: mbfl_passwords_mixed_case_alphabet LEN
Function: mbfl_passwords_mixed_case_alphabet_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_mixed_case_alphabet().

Function: mbfl_passwords_mixed_case_alnum LEN
Function: mbfl_passwords_mixed_case_alnum_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_mixed_case_alnum().

Function: mbfl_passwords_mixed_case_base16 LEN
Function: mbfl_passwords_mixed_case_base16_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_mixed_case_base16().

Function: mbfl_passwords_base32 LEN
Function: mbfl_passwords_base32_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_base32().

Function: mbfl_passwords_base64 LEN
Function: mbfl_passwords_base64_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_base64().

Function: mbfl_passwords_printable_ascii_noblank LEN
Function: mbfl_passwords_printable_ascii_noblank_var RV LEN

Generate a password string; either print it to stdout or store it in the result variable RV. The result string satisfies the string predicate mbfl_string_is_printable_ascii_noblank().


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.