Giter VIP home page Giter VIP logo

keepass-rule-builder's Introduction

KeePass Rule Builder

This is a plugin for the KeePass 2 password manager. With this plugin, you can use the KeePass database to keep track of all of the different requirements that websites have for account passwords, and easily generate new passwords according to those requirements.

The strongest passwords are randomly generated. However, some services unwisely place constraints on the passwords that you can use. A website may state that a password must be less than a certain length, or that it must contain certain types of characters, or that it must not contain certain other characters. To make matters worse, every website has different requirements, so changing passwords means reconfiguring your password generator every time.

The password generator in KeePass helps with these challenges, but it can still be difficult to configure it to exactly meet the requirements of each service while keeping passwords as strong as possible.

The purpose of this plugin is to make it easy to tell KeePass how to generate a password for each service and to streamline the process of changing passwords.

Installation

To install this plugin, download the latest version from the Releases page and copy it into your KeePass installation’s Plugins directory. Do not rename the DLL file. See the KeePass documentation for more help.

This plugin is also available as a Chocolatey package. I am not the maintainer of this package.

How to use

Changing a password

To change a password for an entry in KeePass, right-click the password entry and click Generate New Password.

Context menu with “Generate New Password” selected

The Change Password window will open. This window shows the current password as well as a new randomly generated password. Copy those passwords into the appropriate fields where you are setting the password. You can also use the hotkeys Ctrl+Shift+Z and Ctrl+Shift+X to auto-type the old and new passwords, respectively. If you want to set an expiration date, you can do that here.

Change Password window

Once you have successfully changed the password, click Save New Password to store the new password into the KeePass database. Every time you change the password, the old password will be backed up in the entry’s history.

Password rules

By default, this tool will generate a new password based on the Automatically generated passwords for new entries profile in KeePass. You should configure this profile to produce a very strong password. However, for services for which the passwords generated by this profile are too strong, the plugin can help you generate a password according to each service’s individual password policy.

To specify the rules constraining your password, click the Edit Rule button from the Change Password window, or select Edit Password Rule from the entry context menu. In the Password Rule window, you can specify the rule in one of two ways.

Profile

You can select an existing KeePass profile—either one that is built into KeePass or a custom one that you have created. To choose this option, select Profile and choose the profile you want to use.

The Password Rule dialog with the Profile option selected

Rule

You can also build a password rule by providing a list of the character sets that may, must, or must not be used in the password. To enter a password rule in this way, select the Rule option in the Password Rule dialog.

Let’s say that a website requires passwords with the following properties:

  • A password must be 8–20 characters long.
  • A password must contain at least one letter.
  • A password must contain at least one digit.
  • A password may contain special characters, from the character set !@#$%^&*().
  • Passwords must be changed every 18 months.

As shown in the screenshot below, we will first enter a Length of 20, the maximum password length. (There is no point in generating a password shorter than the maximum length.) Then click the Add Character Set button to add the built-in Letters and Digits character sets, and specify that both of them are Required. Click Add Character Set again to select a Custom character set, which you can then populate with the “special characters” listed in the password requirements. Finally, indicate that a password generated from this rule expires after 18 months.

The Password Rule dialog with the Rule option selected

Other options available in the Add Character Set menu are All characters, Punctuation, Uppercase letters, and Lowercase letters. If the service for which you are generating a password requires that a password not contain certain characters, you can enter those into the Exclude field.

The Add Character Set menu

The Example field in the Edit Rule window shows a sample password that follows the rule or profile that you have selected. (This is not the same password that will be set to the password entry when you save it.)

The password strength is calculated from the configured rule (not the generated password). Every additional bit of strength represents a doubling of the expected time it would take for a hacker to guess the password by brute force.

Once you have finished entering the password requirements, click Accept. If you were editing the rule from the Change Password window, a new password will automatically be generated using your new rule. Follow the steps above to save this password.

Any time you need to generate another password, just use the Generate New Password menu item. It will automatically use the rule and expiration date that you have set for that entry.

Other features

You can access this plugin’s features from the password generation menu in the standard KeePass editor window. Click Generate From Rule to generate a new password based on the entry’s configured rule, or click Edit Password Rule to edit the rule. Click Open Built-in Password Generator to access the normal KeePass password generator.

The Add Entry dialog with the Generate From Rule and Edit Password Rule menu items visible

A rule can be configured for a group of entries. This option is available in the context menu of the group. If a group has a rule configured, all entries in that group will use that rule when a password is generated, unless the rule is overridden in the entry itself.

The group context menu with the Edit Password Rule menu item visible


Icons made by Freepik from www.flaticon.com

keepass-rule-builder's People

Contributors

ihanson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

keepass-rule-builder's Issues

Filter list is no longer displayed after using "Generate New Password".

Steps to Reproduce:

  • Open a Filter List (i.e. Find ->Expired)
  • Right Click on one Entry and then select "Generate New Password..."
  • Generate a new Password and click on "Save new Password"

Expected Behavior:

  • The Filter-List is still open and the selected entry is now no longer marked as Expired (the same behavior, if I update the entry manually)

Actual Behavior:

  • The actual entry is shown is its current location and no longer in the filter list.
  • This is not ideal, because I use the Filter-List (Find -> Expired) to update all my expired password in one go, but with this behavior I've got to reopen the filter-list after each entry again and again.

Compability with KP 2.52 - Dev. 221205 (64-bit)

Hi, for me it looks like as the latest version is not compatible with 2.52 - Dev. 221205 (64-bit). It does not start after compilation, it complains compbility issue. Can you pls check. Thanks in advance !

Compatibility with KeePass 2.50

In KeePass 2.50, the Generate From Rule and Edit Password Rule menu items are missing from the password generation dropdown in the Edit Entry dialog.

Feature request: expand password length

Hi, I'm using your RuleBuilder plugin. And it's fantastic!

But I have some problems with the plugin. Is it possible to make password length longer? When using RuleBuilder window it's restricted to 99 chars max. But some of my passwords are longer and it's impossible to define rule for them.

It is easy to solve the problem using field editing: "just change the value "Length" in "Password Rule" field". But when I define password rule for a whole entry group -- it's impossible to edit this property manually.

Please make it possible to define password length longer than 99 chars. Thanks!

Add ability to specify pattern using KP's built-in placeholders

The ability to "Add Character Set" is nice, but I think it would be even better if it were possible to define placeholder patterns using the same syntax as the built-in password generator profiles.

That way you could have excellent compatibility with existing functionality, and could move patterns out of profiles and into the rules attached to entries themselves.

Here's a quick mock-up of what I'm suggesting:
2019-08-07_154656

Keep the ability to define simple characters, but also add the ability to do custom placeholder patterns.

Default profile

Any chance of having the option to select the default profile to use when generating a new password instead of manually selecting it?

Add password quality meter display?

Is it possible to include a quality meter on the change password dialog box? It wouldn't have to be a bar meter, even just the quality bits number would be helpful to know.

I've really fallen in love with your extension. That said, I find myself guessing at the quality value when using the rule-builder dialog, whereas the built-in interface shows the quality. It might be nice to see both the old & new quality bits, as long as your displaying one, having both for reference might be even better.

Here's a quick mockup of what I was thinking:
kp_quality_meter_mockup

Thoughts?

Feature Request: Minimum Instances of a Character Set

I just had to set up an account which, among other password requirements, had a requirement for at least 6 lowercase characters.

As far as I know, marking a given Character Set as Required will only guarantee at least 1 instance of the Character Set within the resulting password. This could theoretically result in a non-compliant password being generated if other Character Sets are also included and selected.

I would like to be able to configure a Rule that complies with this without needing to resort to workarounds, such as regenerating, increasing the password length, or manually padding the resulting password.

RuleBuilder 3.3 not compatible with KeePass 2.51.1?

I'm getting the following message from KeePass upon startup...

image

I'm running KeePass 2.51.1, released on 2022-05-09. I'm used to .plgx files so wasn't completely sure where to put the .dll, but I've received the same message with the .dll located in both the root KeePass folder and Plugins folder.

Any ideas? Many thanks!!

Entry Expiry Status Not Cleared

Running KeePass 2.48.1 (64 bit, Portable) with v3.0.0.0 of the plugin, I've tried to update a password of an expired entry using the 'Generate New Password...' option.

The password is changed successfully and the expiry date is set correctly.

The issue is that the entry is still shown as expired with a X over the icon and strikethrough font. To clear the expiration status, I had to open the entry and then press OK.

Linked to: #3 (comment)

Change Password - Update the "Expires"-Field

I want to change a password of an account, where I've got to change the password every month.

In this case I use your dialog "Generate new password...", but this has no option to update the "expires"-Field. For this I've got to open the Entry in the normal way and that I've got to update this field.

I think it would be nice to have an option to update this field in one step with changing the password.
And it would be great, if the last uses time-period could be stored in the entry.

I've created a mock for the "new" Generate-Password-Dialog - see Attachement.

Change-Password

On the left side the period could be choosen (it would be nice if this value could be save for this entry) and on the right side the calculated date will be displayed and could be modified (This valuwill be stored in to the entry "expires"-field). The "update"-button on right side should set the date to: today + the selected period.

Dialog contents are failing to render

Environment

  • Operating System: Windows 11 Pro, 22H2, 64-bit, v22621.674
  • KeePass Version: 2.52 (installed)

Note
Reproducible as far back as v2.47.
I haven't tried going back any further since my database's master key depends on the new key file format introduced with this version. Based on my troubleshooting, I do not believe the issue is related to a specific KeePass release.

  • Rule Builder Plugin Version: 3.4

Note
Reproducible as far back as v2.0. I cannot reproduce with v1.0.

Steps to Reproduce

Note
This appears to be intermittently reproducible, but happens more often than not. It's not clear to me what may factor into reproducibility.

  1. Open and unlock a database (in my case, protected with both a master password and key file).

With Change Password Dialog

  1. Right-click an existing entry.
  2. Press the Generate New Password... menu option.

With Edit Rule Dialog

  1. Open the Add/Edit Entry dialog and expand the Generate a password menu, or right-click an existing entry.
  2. Press the Edit Password Rule... menu option.

Expected Behavior

Dialog contents render without issues.

Actual Behavior

Dialog contents fails to render, which significantly cripples the usability of the plugin:

Change Password dialog screenshot

Edit Rule dialog screenshot

Other Notes

The issue persists beyond a Plugin Cache clearing and restart of KeePass.

I normally consume this plugin via the Chocolatey package, although I can also reproduce when manually copied to the Plugins directory.

I've tried building from source (with some minor project reference and post-build event modifications to support my environment), and setting some breakpoints around where the dialog forms are initialized. I would think something would be blowing up around here. Interestingly, no exceptions seem to be thrown anywhere I can see.

I suspect the root cause may be an environmental issue with WPF, as I cannot reproduce on another machine. I'm honestly stumped and not sure where to start with further debugging/troubleshooting this one. Any pointers or other ideas would be much appreciated.

Feature Request : Select from x of y fields

Thanks for the great add-on i use it regularly to generate passwords and track the requirements of various sites.

You currently have required checkbox's so if you have 4 requirements you will get 1 of each.
numbers/lowercase/uppercase/punctuation

Some sites do a select from at least 3 of the 4 or 2 of 3.

You could probably remove the required checkbox's entirely and just replace with a single field with a number. x and a non-edit field which display the number of requirements.

You may say not needed as just select required on all. But just a suggestion

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.