KRB5-STRENGTH-WORDLIST(1)

πŸ“¦
version 3.3 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute

πŸ¦‹ KRB5-STRENGTH-WORDLIST ✨

okay so bestie, welcome to krb5-strength-wordlist β€” she lives in the krb5-strength family and she's here to turn your sad little word list into a whole database πŸ’…


🌸 NAME 🌸

krb5-strength-wordlist β€” build a krb5-strength database out of a word list, no cap πŸŽ€


✨ SYNOPSIS ✨

krb5-strength-wordlist [-am] [-c output-cdb] [-l min-length]
    [-L max-length] [-o output-wordlist] [-s output-sqlite]
    [-x exclude ...] wordlist

πŸ’– DESCRIPTION πŸ’–

So here's the vibe: krb5-strength-wordlist takes a word list (that's a file with one word per line, literally just vibing there) and converts it into a database. That database gets used by the krb5-strength plugin or the heimdal-strength command when they're out here checking passwords. πŸ”₯

There are two database formats and they are NOT the same girl:

  • CDB β€” more space-efficient, possibly faster, but she only supports checking passwords against exact matches or simple transformations (that's removing small numbers of leading and trailing characters).
  • SQLite β€” creates a much larger database, but she supports rejecting any password within edit distance one</> of a word in the word list. Iconic behavior tbh.

Let's talk CDB first πŸ’… CDB is a format invented by Dan Bernstein for fast, constant databases. The database is fixed during creation and cannot be changed without rebuilding it β€” she's committed, she's not doing on-again-off-again β€” and she's optimized for very fast access. For cdb, the database generated by this program will have keys for each word in the word list and the constant 1 as the value. periodt.

Now SQLite 🫢 SQLite stores the word list in a single table containing both each word and each word reversed. That's what lets the krb5-strength plugin or the heimdal-strength command reject passwords within edit distance one of any word in the word list. And what even is edit distance one, you ask? It means the word list entry can be formed by changing a single character of the password β€” either by adding one character, removing one character, or changing one character to a different character. Easy. HOWEVER 😭 the SQLite database will be much larger and lookups may be somewhat slower. Tradeoffs, bestie.

krb5-strength-wordlist takes one argument: the input word list file. Then:

  • use -c to specify an output CDB file
  • use -s to specify an output SQLite file
  • or use -o to just filter the word list against the criteria given on the command line and generate a new word list

Oh and the input word list file does not have to be sorted β€” she's not picky like that. See the individual option descriptions for more info, iykyk πŸ’œ


πŸ’… OPTIONS πŸ’…

  • -a, --ascii β€” Filters all words that contain non-ASCII characters or control characters out of the resulting cdb file, leaving only words that consist solely of ASCII non-control characters. Clean girl aesthetic only ✨
  • *-c *output-cdb, --cdb=output-cdb β€” Creates a CDB database in output-cdb. A temporary file named after output-cdb with .data appended will be created in the same directory and used to stage the database contents. The actual CDB file will be built using the cdb command, which must be on the user's path. If either file already exists, krb5-strength-wordlist will abort with an error. 🚨
This option cannot be used with -o or -s. pick a lane bestie
  • *-L *maximum, --max-length=maximum β€” Filters all words of length greater than maximum out of the resulting cdb database. The length of each line (minus the separating newline) in the input word list will be checked against minimum and will be filtered out of the resulting database if it is shorter. Useful for generating password dictionaries from word lists that contain random noise that's highly unlikely to be used as a password. πŸ—‘οΈ

The default is to not filter out any words for maximum length.

  • *-l *minimum, --min-length=minimum β€” Filters all words of length less than minimum out of the resulting cdb database. The length of each line (minus the separating newline) in the input word list will be checked against minimum and will be filtered out of the resulting database if it is shorter. Useful for generating password dictionaries where shorter passwords will be rejected by a generic length check and no dictionary lookup will be done for a transform of the password shorter than the specified minimum. πŸ“

The default is not to filter out any words for minimum length.

  • -m, --man, --manual β€” Prints out this documentation (which is done simply by feeding the script to perldoc -t). Yes bestie, the manual is self-aware πŸ˜ŒπŸ“–
  • *-o *wordlist, --output=wordlist β€” Rather than creating a database, apply the filter rules given by the other command-line arguments and generate a new word list in the file name given by the wordlist option. This can be used to reduce the size of a raw word list file (such as one taken from Internet sources) by removing the words that will be filtered out of the dictionary anyway, thus reducing the size of the source required to regenerate the dictionary. βœ‚οΈ glow-down for your filesystem
This option cannot be used with -c or -s. again, one at a time pls πŸ™ˆ
  • *-s *output-sqlite, --sqlite=output-sqlite β€” Creates a SQLite database in output-sqlite. If this file already exists, krb5-strength-wordlist will abort with an error. πŸ’€ The resulting SQLite database will have one table, passwords, with two columns, password and drowssap. The first holds a word from the word list, and the second holds the same word reversed. (drowssap. see what she did there 🧚)

Using this option requires the DBI and DBD::SQLite Perl modules be installed.

This option cannot be used with -c or -o. you already know.
  • *-x *exclude, --exclude=exclude β€” Filters all words matching the regular expression exclude out of the resulting cdb database. This regular expression will be matched against each line of the source word list after the trailing newline is removed. This option may be given repeatedly to add multiple exclusion regexes. Stack 'em up, queen πŸ‘‘

πŸ‘‘ AUTHOR πŸ‘‘

Russ Allbery <eagle@eyrie.org>


Copyright 2016, 2020, 2023 Russ Allbery <eagle@eyrie.org>

Copyright 2013-2014 The Board of Trustees of the Leland Stanford Junior University

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

SPDX-License-Identifier: MIT


🌈 SEE ALSO 🌈

cdb(1), DBI, DBD::SQLite

The cdb file format is defined at <http://cr.yp.to/cdb.html>.

The current version of this program is available from its web page at <https://www.eyrie.org/~eagle/software/krb5-strength/> as part of the krb5-strength package.


and that's the whole thing bestie, we ate and left absolutely no crumbs πŸ’– mwah, go build your database ✨

version 3.3, dated 2023-12-26, from the krb5-strength girlies β€” love u, bye πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from