Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add passphrase-generator plugin #30

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

GrantMoyer
Copy link

This plugins generates passphrases using the EFF's long wordlist. Implements keeweb/keeweb#210.

The functionality is currently very basic: it adds adds a preset to the password generator view called "passphrase", and lets you choose the number of space-seperated words to generate with the length slider. It ignores all the other options from the generator view.

In the future, I'd like to improve the UX for the plugin by removing extraneous options from the generator view and allowing the user to save custom passphrase presets. I'd also like to add an option the change the word seperator, for example from ' ' to '-'.

Currently, the wordlist is not compressed, since there is no decompression api exposed to plugins. However, even with compression, the wordlist would need to be stored in the plugin.js file, likely in base64, since plugins cannot access external resources. The uncompressed wordlist is 60KiB, while the deflate compressed list, encoded in base64, is 32KiB.

Passphrase generator view:

passphrase-generator-view

This plugins generates passphrases using the [EFF's long wordlist][1]. Implements keeweb/keeweb#210.

The functionality is currently very basic: it adds adds a preset to the password generator view called "passphrase", and lets you choose the number of space-seperated words to generate with the length slider. It ignores all the other options from the generator view.

In the future, I'd like to improve the UX for the plugin by removing extraneous options from the generator view and allowing the user to save custom passphrase presets. I'd also like to add an option the change the word seperator, for example from ' ' to '-'.

Currently, the wordlist is not compressed, since there is no decompression api exposed to plugins. However, even with compression, the wordlist would need to be stored in the plugin.js file, likely in base64, since plugins cannot access external resources. The uncompressed wordlist is 60KiB, while the deflate compressed list, encoded in base64, is 32KiB.

[1]: https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases
@GrantMoyer
Copy link
Author

GrantMoyer commented Mar 20, 2022

In order to implement some of the mentioned improvements, the plugins api would need to expose a few more things:

To remove extraneous options from the generator view, either:

  • Parameterize the generator view's options with template arguments.
  • Expose Handlebars.compile() for making custom templates. The new template can be swapped in during the view's render function.

To compress the wordlist, either:

  • Add compression functions to kdbxweb.
  • Expose compression library directly to plugins, i.e. fflate.

@GrantMoyer GrantMoyer marked this pull request as draft March 21, 2022 22:23
@GrantMoyer
Copy link
Author

GrantMoyer commented Mar 21, 2022

I don't think this is polished enough to be an official plugin yet. I'll work on the new interfaces keeweb needs to polish this, then revisit it.

GrantMoyer added a commit to GrantMoyer/keeweb that referenced this pull request Mar 26, 2022
Before this change, generator view options were static, so all generators needed to work with the same options. This change parameterizes the options, so that plugins can provide different sets of options for custom generators. In particular, this change enables hiding the default options for generators where it doesn't make sense, such as the passphrase generator in keeweb/keeweb-plugins#30.
@GrantMoyer
Copy link
Author

Can now save passphrase presets with keeweb/keeweb#2002:

passphrase-preset

@GrantMoyer GrantMoyer marked this pull request as ready for review March 29, 2022 23:27
@GrantMoyer
Copy link
Author

I forgot to add an updated image of to generator view:

passphrase-generator-view-2

@Aetherinox
Copy link
Contributor

Aetherinox commented Apr 27, 2024

Great minds think alike. I am just now seeing this.

I have implemented a passphrase system into KeeWeb, as well as using a version of the EFF passphrase list which is also implemented by KeePassXC.

The thing I didn't add were presets yet; because I'm juggling in my head if that popup box is going to last with all the settings and full functionality that needs added, or if I should just expand it. Still battling that one in my head.

However, I also saw your other PR about making the generation settings modular, and I agree. I already started doing some work to it, but it definitely needs more. At present, it disables the checkboxes that make no sense so that you don't automatically just pop back to "custom".

However, I'd like to take it deeper.

I'll look at your other submission, and see what it offers and see if I can merge the differences. Right now it's just about stability and getting things back on track.

@Aetherinox Aetherinox self-assigned this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants