Password Generator - KeePass (2024)

Password Generator - KeePass (1)

Details about the built-in password generator of KeePass.

  • Generation Based on Character Sets
  • Generation Based on Patterns
  • Generating Passwords that Follow Rules
  • Security-Reducing Options
  • Creating and Using Password Generator Profiles
  • Configuring Settings of Automatically Generated Passwords for New Entries

Password Generator - KeePass (2)Generation Based on Character Sets

This password generation method is the recommended way to generate random passwords.Other methods (pattern-based generation, ...) should only be used if passwords mustfollow special rules or fulfill certain conditions.

Generation based on a character set is very simple. You simply let KeePass knowwhich characters can be used (e.g. upper-case letters, digits, ...) and KeePass willrandomly pick characters out of the set.

Defining a character set:
The character set can be defined directly in the password generator window. For convenience,KeePass offers adding commonly used ranges of characters to the set. This is done byticking the appropriate check box. Additionally to these predefined character ranges, youcan specify characters manually: all characters that you enter in the 'Also include thefollowing characters' text box will be directly added to the character set.

The characters that you enter in the 'Also include the following characters'text box are included in the character set from which the password generator randomlychooses characters from.This means that these additional characters are allowed to appear in thegenerated passwords, but they are not forced to.If you want to force that some characters appear in the generated passwords,you have to use the pattern-based generation.

Character sets are sets:
In mathematical terms, character sets are sets, not vectors. This means that characterscannot be added twice to the set. Either a character is in the set or it is not.

For example, if you enter 'AAAAB' into the additional characters box, this isexactly the same set as 'AB'. 'A' will not be 4 times as likely as 'B'!If you need to follow rules like 'character A is more likely than B', you mustuse pattern-based generation + permuting password characters.

KeePass will 'optimize' your character set by removing all duplicate characters. Ifyou'd enter the character set 'AAAAB' into the additional characters box,close and reopen the password generator, it'll show the shorter character set 'AB'.Similarly, if you tick the 'Digits' check box and enter '3' into theadditional box, the '3' will be ignored because it is already included in the'Digits' character range.

Supported characters:
All Unicodecharacters in the ranges [U+0001, U+D7FF] and [U+E000, U+FFFF]except { U+0009 / '\t', U+000A / '\n', U+000D / '\r' } are supported.Characters in the range [U+010000, U+10FFFF] (which need to be encodedin UTF-16 using surrogate pairs from [0xD800, 0xDFFF]) are not supported.Subsequent processing of passwords may have further limitations(for example, the character U+FFFF is forbidden in XML/KDBX filesand will be replaced or removed).


Password Generator - KeePass (3)Generation Based on Patterns

The password generator can create passwords using patterns. A pattern is astring defining the layout of the new password. The following placeholdersare supported:

PlaceholderTypeCharacter Set
aLower-Case Alphanumericabcdefghijklmnopqrstuvwxyz 0123456789
AMixed-Case AlphanumericABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
UUpper-Case AlphanumericABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
dDigit0123456789
hLower-Case Hex Character0123456789 abcdef
HUpper-Case Hex Character0123456789 ABCDEF
lLower-Case Letterabcdefghijklmnopqrstuvwxyz
LMixed-Case LetterABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
uUpper-Case LetterABCDEFGHIJKLMNOPQRSTUVWXYZ
vLower-Case Vowelaeiou
VMixed-Case VowelAEIOU aeiou
ZUpper-Case VowelAEIOU
cLower-Case Consonantbcdfghjklmnpqrstvwxyz
CMixed-Case ConsonantBCDFGHJKLMNPQRSTVWXYZ bcdfghjklmnpqrstvwxyz
zUpper-Case ConsonantBCDFGHJKLMNPQRSTVWXYZ
pPunctuation,.;:
bBracket()[]{}<>
sPrintable 7-Bit Special Character!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
SPrintable 7-Bit ASCIIA-Z, a-z, 0-9, !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
xLatin-1 SupplementRange [U+00A1, U+00FF] except U+00AD:
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
\Escape (Fixed Char)Use following character as is.
{n}Escape (Repeat)Repeat the previous placeholder n times.
[...]Custom Char SetDefine a custom character set.

The \ placeholder is special: it's an escape character. The next character that followsthe \ is written directly into the generated password. If you want a \ in yourpassword at a specific place, you have to write \\.

Using the {n} code you can define how many times the previous placeholdershould occur. The { } operator duplicates placeholders, not generated characters. Examples:
» d{4} is equivalent to dddd,
» dH{4}a is equivalent to dHHHHa and
» Hda{1}dH is equivalent to HdadH.

The [...] notation can be used to define a custom character set, from whichthe password generator will pick one character randomly. All characters between the '['and ']' brackets follow the same rules as the placeholders above.The '^' character removes the next placeholders from the character set.Examples:
» [dp] generates exactly 1 random character out of the setdigits + punctuation,
» [d\m\@^\3]{5} generates 5 characters out of the set "012456789m@",
» [u\_][u\_] generates 2 characters out of the set upper-case + '_'.

More examples:

ddddd
Generates for example: 41922, 12733, 43960, 07660, 12390, 74680, ...

\H\e\x\:\ HHHHHH
Generates for example: 'Hex: 13567A', 'Hex: A6B99D', 'Hex: 02243C', ...

Common password patterns:

NamePattern
Hex Key - 40-BitH{10}
Hex Key - 128-BitH{32}
Hex Key - 256-BitH{64}
MAC AddressH\2\-HH\-HH\-HH\-HH\-HH

Password Generator - KeePass (4)Generating Passwords that Follow Rules

Below are a few examples how the pattern generation feature can be used to generatepasswords that follow certain rules.

Important! For all of the following examples you must enable the 'Randomly permutecharacters of password' option!

RulePattern
Must consist of 2 upper-case letters, 2 lower-case letters and 2 digits.uulldd
Must consist of 9 digits and 1 letter.d{9}L
Must consist of 10 alphanumeric characters, where at least 1 isa letter and at least 1 is a digit.LdA{8}
Must consist of 10 alphanumeric characters, where at least 2 areupper-case letters and at least 2 are lower-case letters.uullA{6}
Must consist of 9 characters of the set "ABCDEF" andan '@' symbol.\@[\A\B\C\D\E\F]{9}

Password Generator - KeePass (5)Security-Reducing Options

The password generator supports several options like 'Each character must occur at most once','Exclude look-alike characters' (O0, Il1|)and a field to explicitly specify characters that should not appear in generated passwords.

These options are reducing the security of generated passwords. You shouldonly enable them if you are forced to follow such rules by the website/application,for which you are generating the password.

The options can be found in the 'Advanced' dialog / tab page.

KeePass 1.x Only

Password Generator - KeePass (6)If you enable a security-reducing option, the 'Advanced' button
in the password generator window is shown in red.


KeePass 2.x Only

Password Generator - KeePass (7)If you enable a security-reducing option, an exclamation mark (!)
is appended to the 'Advanced' tab.

Password Generator - KeePass (8)Creating and Using Password Generator Profiles

Password generator options (character set, length, pattern, ...) can be savedas password generator profiles.

Creating/modifying a profile:

  1. Open the Password Generator window.
  2. Specify all options of the new profile.
  3. Click the Password Generator - KeePass (9)'Save as Profile' button.
  4. Enter the name of the new profile, or select an existing profile name fromthe drop-down list to overwrite it. Close the dialog with OK.
  5. If you want to immediately create a password using the new profile,click OK/Accept. Otherwise click Cancel/Close (the profile is not lost;profile management is independent of password generation).

Using a profile:
To use a profile, simply select it from the drop-down profiles listin the password generator window. All settings of this profile will berestored accordingly.

Meta-profile 'Derive from previous password':
When this meta-profile is selected, a password is generated based ona character set derived from the previous password. The new passwordhas the same length as the old one, and every character of the oldpassword turns on the character subset that contains this character.For example, if the old password contains the letter 'R', then the characterset used for generating the new password contains the range 'A' to 'Z'.
Warning! This meta-profile should not be used blindly(i.e. without reviewing the used character set).The new password does not necessarily contain at least one characterfrom each character subset (see 'GenerationBased on Character Sets'), thus blindly generating new passwordswith this meta-profile can result in a quality degradation of theeffectively used profile.


Password Generator - KeePass (10)Configuring Settings of Automatically Generated Passwords for New Entries

When you create a new entry, KeePass will automatically generate a randompassword for it. The properties of these generated passwords can be configuredin the password generator dialog.

To configure, specify the options of your choice and overwrite the'(Automatically generated passwords for new entries)' profile (seesection above).

Disabling automatically generated passwords:
To disable automatically generated passwords for new entries, select'Generate using character set' and specify 0 as password length.Overwrite the appropriate profile (see above).



Password Generator - KeePass (2024)
Top Articles
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6762

Rating: 4.6 / 5 (46 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.