Skip to content

Commit

Permalink
Fix bugs; migrate to Alfred 3; Improve icons
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Feb 26, 2017
1 parent 25011cd commit 1d70726
Show file tree
Hide file tree
Showing 27 changed files with 1,371 additions and 512 deletions.
Binary file added Icons.iconsproj
Binary file not shown.
Binary file added Icons.pxm
Binary file not shown.
Binary file removed Password Generator-1.4.alfredworkflow
Binary file not shown.
Binary file added Password-Generator-2.0.alfredworkflow
Binary file not shown.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Generate secure random passwords from Alfred. Uses `/dev/urandom` as source of e
- [Changelog](#changelog)
- [Version 1.0 (2015-07-28)](#version-10-2015-07-28)
- [Version 1.1 (2015-07-28)](#version-11-2015-07-28)
- [Version 1.2 (2015-07-31)](#version-12-2015-07-31)
- [Version 1.3 (2015-11-03)](#version-13-2015-11-03)
- [Version 2.0 (2017-02-26)](#version-20-2017-02-26)


## Installation ##
Expand Down Expand Up @@ -77,7 +80,13 @@ Passwords can be specified either by strength or length. The default strength is

Default length is 20 characters, which can provide ~50 to ~130 bits of entropy depending on generator.

Each password has its strength in the result subtitle. This is shown either as a bar or in bits of entropy, depending on your settings. Each full block in the bar represents 32 bits of entropy.
Each password has its strength in the result subtitle. This is shown either as a bar or in bits of entropy, depending on your settings. Each full block in the bar represents 32 bits of entropy. The icon shown next to each password also reflects its strength:

| Icon | Strength (bits of entropy) |
| ------------------------------- | -------------------------- |
| ![](./strong.png "strong.png") | Strength >= 96b |
| ![](./okay.png "okay.png") | Strength > 64b and < 96b |
| ![](./weak.png "weak.png") | Strength <= 64b |


### Entropy? ###
Expand Down Expand Up @@ -128,7 +137,7 @@ See [Password strength on Wikipedia](https://en.wikipedia.org/wiki/Password_stre

## Configuration ##

Access the configuraton options with the `pwconf` keyword. You can use an optional query to filter the available options, e.g. use `pwconf gen` to show only the available generators.
Access the configuration options with the `pwconf` keyword. You can use an optional query to filter the available options, e.g. use `pwconf gen` to show only the available generators.

The following configuraton options are available:

Expand Down Expand Up @@ -342,7 +351,7 @@ The code for the Markov chain comes from [a SimonSapin snippet][markov], and the

It is heavily based on the [Alfred-Workflow](https://github.com/deanishe/alfred-workflow) library, also released under the MIT Licence.

The workflow icon is from the [IcoMoon](https://icomoon.io/) webfont \([licence](https://icomoon.io/#termsofuse)\).
The workflow icon is from the [Elusive Icons](https://github.com/aristath/elusive-iconfont) webfont \([licence](http://scripts.sil.org/OFL)\).

The other icons are based on the [Font Awesome](http://fortawesome.github.io/Font-Awesome/) webfont \([licence](http://scripts.sil.org/OFL)\).

Expand Down Expand Up @@ -375,6 +384,14 @@ Initial release
- Change `id_` property of generators to `id`


### Version 2.0 (2017-02-26) ###

- Icons reflect password strength
- Alfred 3 only
- Option to turn notifications off #3
- Fix syntax error #11


[demo]: https://github.com/deanishe/alfred-pwgen/raw/master/demo.gif "Alfred Password Generator Demo"
[gh-releases]: https://github.com/deanishe/alfred-pwgen/releases
[packal]: http://www.packal.org/workflow/secure-password-generator
Expand Down
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icon.pxm
Binary file not shown.
Binary file added okay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 1 addition & 7 deletions src/generators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def password(self, strength=None, length=None):
Returns tuple: (password, entropy)
"""

if strength is not None:
length = int(math.ceil(strength / self.entropy))

Expand All @@ -96,6 +95,7 @@ def password(self, strength=None, length=None):

@property
def entropy(self):
"""Entropy per element (character word) in bits."""
return math.log(len(self.data), 2)

@abc.abstractproperty
Expand All @@ -105,7 +105,6 @@ def id(self):
Used in settings to identify the generator.
"""

return

@abc.abstractproperty
Expand All @@ -126,7 +125,6 @@ def data(self):

def _get_generator_modules(dirpath):
"""Return list of files in dirpath matching ``gen_*.py``"""

modnames = []

for filename in os.listdir(dirpath):
Expand Down Expand Up @@ -175,7 +173,6 @@ def password(self, strength=None, length=None):
Returns tuple: (password, entropy)
"""

if strength is not None:
iterations = int(math.ceil(strength / self.entropy))
return self._password_by_iterations(iterations)
Expand All @@ -192,7 +189,6 @@ def import_generators(dirpath):
As a result, user modules may override built-ins.
"""

dirpath = os.path.abspath(dirpath)

if dirpath in imported_dirs:
Expand Down Expand Up @@ -227,7 +223,6 @@ def get_subclasses(klass):
Also recurses into subclasses.
"""

subclasses = []

for cls in klass.__subclasses__():
Expand All @@ -245,7 +240,6 @@ def get_generators():
to enforce interface compliance :(
"""

generators = []
builtin_dir = os.path.abspath(os.path.dirname(__file__))

Expand Down
2 changes: 1 addition & 1 deletion src/generators/gen_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def description(self):
@property
def data(self):
data = (set(string.ascii_letters) | set(string.digits))
data = data - set('l10O')
data = data - set('iIlL10Oo')
return ''.join(data)


Expand Down
Binary file modified src/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/icon.icns
Binary file not shown.
Binary file added src/icons/okay.icns
Binary file not shown.
Binary file added src/icons/strong.icns
Binary file not shown.
Binary file added src/icons/weak.icns
Binary file not shown.
Loading

0 comments on commit 1d70726

Please sign in to comment.