{"id":13586514,"url":"https://github.com/deanishe/alfred-pwgen","last_synced_at":"2025-04-09T12:08:42.080Z","repository":{"id":35534512,"uuid":"39805584","full_name":"deanishe/alfred-pwgen","owner":"deanishe","description":"Generate passwords with Alfred","archived":false,"fork":false,"pushed_at":"2022-08-02T07:58:53.000Z","size":9606,"stargazers_count":292,"open_issues_count":9,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T10:14:53.367Z","etag":null,"topics":["alfred","alfred-workflow","extensible","markov-chain","password-generator","plugins"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deanishe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T01:01:10.000Z","updated_at":"2025-03-21T17:53:20.000Z","dependencies_parsed_at":"2022-07-09T08:00:39.201Z","dependency_job_id":null,"html_url":"https://github.com/deanishe/alfred-pwgen","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanishe%2Falfred-pwgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanishe%2Falfred-pwgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanishe%2Falfred-pwgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanishe%2Falfred-pwgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deanishe","download_url":"https://codeload.github.com/deanishe/alfred-pwgen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036067,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alfred","alfred-workflow","extensible","markov-chain","password-generator","plugins"],"created_at":"2024-08-01T15:05:37.454Z","updated_at":"2025-04-09T12:08:42.062Z","avatar_url":"https://github.com/deanishe.png","language":"Python","funding_links":[],"categories":["Python","Utility","Security"],"sub_categories":[],"readme":"\n# Alfred Password Generator #\n\nGenerate secure random passwords from Alfred. Uses `/dev/urandom` as source of entropy.\n\n![Alfred Password Generator Demo][demo]\n\n\n## Features ##\n\n- Passwords can be generated based on strength or length.\n- Offers multiple generators, including based on real words and pronounceable pseudo-words generated with Markov chains.\n- Shows the strength of each generated password.\n- More convenient than 1Password or the like.\n- More dependable than online generators.\n- Copies passwords as \"concealed\" data by default (so clipboard managers don't record them).\n\n\n## Contents ##\n\n\u003c!-- MarkdownTOC autolink=\"true\" --\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Password strength](#password-strength)\n  - [Entropy?](#entropy)\n  - [How strong should my passwords be?](#how-strong-should-my-passwords-be)\n    - [Displayed strength](#displayed-strength)\n    - [How can passwords of the same length have different levels of security?](#how-can-passwords-of-the-same-length-have-different-levels-of-security)\n- [Configuration](#configuration)\n  - [Open Help](#open-help)\n  - [An Update is Available / No Update is Available](#an-update-is-available--no-update-is-available)\n  - [Default Password Strength](#default-password-strength)\n  - [Default Password Length](#default-password-length)\n  - [Strength Bar](#strength-bar)\n  - [Generators](#generators)\n- [Built-in generators](#built-in-generators)\n  - [Active generators](#active-generators)\n    - [ASCII Generator](#ascii-generator)\n    - [Alphanumeric Generator](#alphanumeric-generator)\n    - [Clear Alphanumeric Generator](#clear-alphanumeric-generator)\n    - [Numeric Generator](#numeric-generator)\n    - [Pronounceable Nonsense Generator](#pronounceable-nonsense-generator)\n    - [Dictionary Generator](#dictionary-generator)\n  - [Inactive generators](#inactive-generators)\n    - [Pronounceable Markov Generator](#pronounceable-markov-generator)\n    - [Hexadecimal Generator](#hexadecimal-generator)\n    - [German Generator](#german-generator)\n    - [German Alphanumeric Generator](#german-alphanumeric-generator)\n    - [German Pronounceable Markov Generator](#german-pronounceable-markov-generator)\n- [Custom generators](#custom-generators)\n  - [Examples](#examples)\n- [Licensing, thanks](#licensing-thanks)\n- [Changelog](#changelog)\n  - [Version 1.0 \\(2015-07-28\\)](#version-10-2015-07-28)\n  - [Version 1.1 \\(2015-07-28\\)](#version-11-2015-07-28)\n  - [Version 1.2 \\(2015-07-31\\)](#version-12-2015-07-31)\n  - [Version 1.3 \\(2015-11-03\\)](#version-13-2015-11-03)\n  - [Version 2.0 \\(2017-02-26\\)](#version-20-2017-02-26)\n  - [Version 2.0.1 \\(2017-04-01\\)](#version-201-2017-04-01)\n  - [Version 2.0.2 \\(2017-04-01\\)](#version-202-2017-04-01)\n  - [Version 2.1 \\(2017-04-02\\)](#version-21-2017-04-02)\n  - [Version 2.1.1 \\(2017-04-19\\)](#version-211-2017-04-19)\n  - [Version 2.1.2 \\(2017-12-10\\)](#version-212-2017-12-10)\n  - [Version 2.1.3 \\(2019-07-13\\)](#version-213-2019-07-13)\n\n\u003c!-- /MarkdownTOC --\u003e\n\n\n## Installation ##\n\nDownload from the [GitHub releases][gh-releases] or [Packal][packal] and double-click the downloaded file to install.\n\n\n## Usage ##\n\n- `pwgen [\u003cstrength\u003e]` — Generate passwords of specified strength. Default is `3` (96 bits of entropy). See [Password strength](#password-strength) for details.\n    - `↩` — Copy the selected password to the clipboard.\n    - `⌘↩` — Copy the selected password to the clipboard and paste it to the frontmost application.\n    - `⌥↩` or `⌘C` — Copy the selected password to the clipboard *as public data*\n    - `^↩` — Copy the selected password to the clipboard *as public data* and paste it to the frontmost application.\n    - `⌘+L` — Show the selected password in Alfred's Large Text window.\n- `pwlen [\u003clength\u003e]` — Generate passwords of specified length. Default is `20`. See [Password strength](#password-strength) for details.\n    - `↩` — Copy the selected password to the clipboard.\n    - `⌘↩` — Copy the selected password to the clipboard and paste it to the frontmost application.\n    - `⌥↩` or `⌘C` — Copy the selected password to the clipboard *as public data*\n    - `^↩` — Copy the selected password to the clipboard *as public data* and paste it to the frontmost application.\n    - `⌘+L` — Show the selected password in Alfred's Large Text window.\n- `pwconf [\u003cquery\u003e]` — View and edit workflow settings. See [Configuration](#configuration) for details.\n\n**Note:** Word-based generators may provide passwords that are slightly longer than `\u003clength\u003e`.\n\n\n## Password strength ##\n\nPasswords can be specified either by strength or length. The default strength is `3`, which is at least 96 bits of entropy (each level is 32 bits). You may also specify the desired number of bits by appending `b` to your input, e.g. `pwgen 128b` will provide at least 128 bits of entropy.\n\nDefault length is 20 characters, which can provide ~50 to ~130 bits of entropy depending on generator.\n\nEach 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:\n\n| Icon                            | Strength (bits of entropy) |\n| ------------------------------- | -------------------------- |\n| ![](./strong.png \"strong.png\")  | Strength \u003e= 96b            |\n| ![](./okay.png \"okay.png\")      | Strength \u003e 64b and \u003c 96b   |\n| ![](./weak.png \"weak.png\")      | Strength \u003c= 64b            |\n\n\n### Entropy? ###\n\n\"Entropy\" is [cryptographese for \"randomness\"][entropy].\n\n\n### How strong should my passwords be? ###\n\nThat depends on what you're using it for and how long you want it to remain secure. As of 2015, custom password-guessing hardware (built from standard PC components) can guess **\u0026gt;45 billion passwords per second.**\n\nThe *average* number of guesses required to crack a password with *n* bits of entropy is 2\u003csup\u003en-1\u003c/sup\u003e, so 2,147,483,647 guesses for a 32-bit password. Or **0.048 seconds** with the above hardware.\n\nFortunately, every added bit doubles the amount of entropy, so 64 bits is a good deal stronger: 6.5 *years* on average to guess on the same hardware.\n\n| Level   | Min. entropy          | Av. time to guess\u0026nbsp;\\*                         | Application                               |\n| ------: | --------------------: | --------------:                               | ---------------------------               |\n| 1       | 32\u0026nbsp;bits          | 0.048 seconds                                 | Stuff you want to be super easy to crack? |\n| 2       | 64\u0026nbsp;bits          | 6.5 years                                     | Web accounts, WiFi passwords              |\n| 3       | 96\u0026nbsp;bits          | 280 million years                             | Almost anything                           |\n| 4       | 128\u0026nbsp;bits         | billions of times the age of the universe | Toppest-secret stuff, e.g. encryption keys\u0026nbsp;\\*\\*                           |\n\n\\* = based on 45 billion guesses per second.\n\\*\\* = *symmetric* encryption keys. SSL certificates, for example, use *asymmetric* keys, which offer much less security per bit. A 1024-bit RSA key has roughly equivalent security to an 80-bit symmetric key.\n\nThe default password strength level of 3 (96 bits) provides very secure passwords.\n\nThe default password length of 20 characters provides reasonably to very secure passwords, depending on the generator.\n\n\n#### Displayed strength ####\n\nBy default, the strength of generated passwords is shown as a bar in the result subtitle. Each full block represents 32 bits of entropy, so 2 blocks represents a pretty secure password, 3 or more a very secure password.\n\nYou can have the precise number of bits displayed instead by toggling the \"Strength Bar\" setting in the [Configuration](#configuration) (keyword `pwconf`).\n\n\n#### How can passwords of the same length have different levels of security? ####\n\nPasswords of the same length (or even the self-same password) generated using different techniques have different strengths because the strength is determined by the permutations in the algorithm and the password length, not the password itself.\n\nFor example, the single-digit password `1` has an entropy of 3.32 bits when generated by the Numeric algorithm because it is one of only 10 possible one-digit passwords. The same password generated by the ASCII algorithm has an entropy of 5.95 bits because it is one of 62 possible one-character passwords.\n\nOf course, that's just in theory. A password generated by the German generator is theoretically more secure than the same password generated by the ASCII-only one because the former has more possible passwords of any given length. That only holds in practice if an attacker is also guessing passwords based on the German alphabet. If they're guessing based on ASCII, and the password only contains ASCII characters, the password is naturally as easily guessed as if it had been generated by the ASCII generator.\n\nSee [Password strength on Wikipedia](https://en.wikipedia.org/wiki/Password_strength#Random_passwords) for more information.\n\n\n## Configuration ##\n\nAccess 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.\n\nThe following configuraton options are available:\n\n\n### Open Help ###\n\nAction this item to open this README in your browser.\n\n\n### An Update is Available / No Update is Available ###\n\nThe workflow checks for a new version once a day. If one is available, \"An Update is Available\" will be shown. Action this item to install the update.\n\nIf no update is available, \"No Update is Available\" will be shown. Action this item to force a check for an update.\n\n\n### Default Password Strength ###\n\nThe default strength for passwords generated with `pwgen`. For strength *n*, passwords will have *n*\\*32 bits of entropy. Default is `3`, which should be proof against anything but the NSA. `4` will generate extremely secure passwords.\n\nAction this item to enter a new default strength.\n\n\n### Default Password Length ###\n\nThe default length in characters for passwords generated with `pwlen`. The default of `20` provides passwords that are reasonably to very secure, depending on the generator.\n\nAction this item to enter a new default length.\n\n\n### Strength Bar ###\n\nBy default, password strength is indicated by a number of blocks. Each full block represents 32 bits of entropy, so 3 blocks is secure, 4 is very secure. Less that 3 blocks should be avoided.\n\nAlternatively, strength can be shown as the number of bits of entropy.\n\nAction this item to toggle the strength bar on/off.\n\n\n### Generators ###\n\nAll the available generators are listed below the other options.\n\nActive generators have a checked green circle as their icon, inactive ones have an empty red circle icon.\n\nAction a generator to toggle it on or off.\n\n## Built-in generators ##\n\nSee [below](#custom-generators) for details of how to add your own custom generators.\n\nThe workflow includes 10 built-in generators, of which 6 are active by default. You can activate/deactivate them in the [Configuration](#configuration).\n\n**Note**: Word-based password generators return passwords with their component words joined by hyphens. These hyphens are not included in the calculation of the password strength, so removing them will leave you with a password of the stated strength.\n\n\n### Active generators ###\n\nThese generators are active by default.\n\n#### ASCII Generator ####\n\nGenerates passwords based on all ASCII characters, minus a few punctuation marks that can be hard to type, such as \\\\\\`~ (backslash, backtick, tilde).\n\n\n#### Alphanumeric Generator ####\n\nGenerates passwords from ASCII letters and digits. No punctuation.\n\n\n#### Clear Alphanumeric Generator ####\n\nGenerates passwords from ASCII letters and digits, excluding the easily-confused characters lO01 (lowercase L, uppercase O, the digits 1 and 0).\n\n\n#### Numeric Generator ####\n\nGenerates digit-only passwords.\n\n\n#### Pronounceable Nonsense Generator ####\n\nGenerates pronounceable passwords based on nonsense words. Based on [this Stack Overflow answer](http://stackoverflow.com/a/5502875).\n\n\n#### Dictionary Generator ####\n\nGenerates passwords based on the words in `/usr/share/dict/words`.\n\n\n### Inactive generators ###\n\nThese generators are inactive by default. They can be turned on in the [Configuration](#configuration).\n\n\n#### Pronounceable Markov Generator ####\n\nGenerates semi-pronounceable passwords based on Markov chains and the start of *A Tale of Two Cities*.\n\nHas slightly more entropy than the [Pronounceable Nonsense generator](#pronounceable-nonsense-generator), but the passwords aren't quite as pronounceable.\n\n\n#### Hexadecimal Generator ####\n\nGenerate passwords using hexadecimal characters (0-9, a-f).\n\n\n#### German Generator ####\n\nGenerate passwords using the German alphabet, digits and punctuation.\n\n\n#### German Alphanumeric Generator ####\n\nGenerate passwords using the German alphabet and digits without punctuation.\n\n\n#### German Pronounceable Markov Generator ####\n\nGenerates semi-pronounceable passwords based on Markov chains and the start of *Buddenbrooks*.\n\n\n## Custom generators ##\n\nYou can easily add your own custom password generators. These must be placed in the directory `~/Library/Application Support/Alfred 2/Workflow Data/net.deanishe.alfred-pwgen/generators/`. If you put your custom generators in the workflow itself, they will be deleted when the workflow is updated. You can quickly open up the above directory by entering the Alfred-Workflow magic argument `workflow:opendata` as your query, e.g. `pwconf workflow:opendata`.\n\n**Note**: Your generators will be deactivated by default. You must manually activate them using `pwconf` to use them.\n\nModules containing your custom generators *must* be named `gen_XXX.py`.\n\nOnly files matching the pattern `gen_*.py` will be imported.\n\nYour generator classes *must* subclass `generators.PassGenBase` or `generators.WordGenBase`, which are [abstract base classes][abcs], and *must* have `id`, `name`, `description` and `data` properties. These have the following purposes:\n\n|    Property   |                                    Purpose                                    |\n|---------------|-------------------------------------------------------------------------------|\n| `id`          | Short name for your generator; used internally.                               |\n| `name`        | The human-readable name; shown in the configuration.                          |\n| `description` | The longer description shown beneath the generator name in the configuration. |\n| `data`        | Return a sequence of the characters to generate passwords from.               |\n\n\nThe `data` property is used by the `entropy` property and `password()` method on the `PassGenBase` base class.\n\n`PassGenBase` is designed for character-based passwords, i.e. `data` returns a string or other sequence of single characters. `WordGenBase` is for word-based passwords, i.e. `data` returns a sequence of multi-character strings. The main difference is in the implementation of length-based passwords.\n\n**Important:** `data` must return a sequence (`string`, `list` or `tuple`) *not* a generator or `set`. If `random.choice()` chokes on it, it's no good.\n\n\n### Examples ###\n\nA generator to produce German passwords (i.e. possibly including letters like 'ü' or 'ä'):\n\n```python\n\nimport string\nfrom generators import PassGenBase, punctuation\n# punctuation is `string.punctuation` minus a few\n# problematic/hard-to-type symbols (e.g. backslash)\n\nclass GermanGenerator(PassGenBase):\n    \"\"\"Generate passwords containing umlauts.\"\"\"\n\n    @property\n    def id(self):\n        return 'deutsch'\n\n    @property\n    def name(self):\n        return 'German'\n\n    @property\n    def description(self):\n        return 'German alphabet, digits and punctuation'\n\n    @property\n    def data(self):\n        return string.ascii_letters + string.digits + punctuation + 'üäöÜÄÖß'\n```\n\nA word-based generator to produce Swedish passwords might look like this:\n\n```python\nfrom generators import WordGenBase\n\nclass BorkGenerator(WordGenBase):\n    \"\"\"Bork-bork-bork\"\"\"\n\n    @property\n    def id(self):\n        return 'bork'\n\n    @property\n    def name(self):\n        return 'Bork'\n\n    @property\n    def description(self):\n        return 'Borked password generator'\n\n    @property\n    def data(self):\n        return ['bork', 'bork', 'bork']\n```\n\n## Licensing, thanks ##\n\nThis workflow is released under the [MIT Licence](http://opensource.org/licenses/MIT), which is included as the LICENCE file.\n\nThe code for the Markov chain comes from [a SimonSapin snippet][markov], and the gibberish-generating code is from a [Greg Haskins StackOverflow answer][gibberish].\n\nIt is heavily based on the [Alfred-Workflow](https://github.com/deanishe/alfred-workflow) library, also released under the MIT Licence.\n\nThe workflow icon is from the [Elusive Icons](https://github.com/aristath/elusive-iconfont) webfont \\([licence](http://scripts.sil.org/OFL)\\).\n\nThe other icons are based on the [Font Awesome](http://fortawesome.github.io/Font-Awesome/) webfont \\([licence](http://scripts.sil.org/OFL)\\).\n\n\n## Changelog ##\n\n### Version 1.0 (2015-07-28) ###\n\nInitial release\n\n\n### Version 1.1 (2015-07-28) ###\n\n- Replace default Markov pronounceable generator with gibberish\n- Rename Dictionary generator module\n- Add licence and licensing info\n- Improve usage description in README\n- Add generator descriptions to README\n- Add strength bar toggle to configuration\n- Improve filtering in configuration\n\n### Version 1.2 (2015-07-31) ###\n\n- Add separate base class for word-based generators\n- Add custom (user) generator support\n- Refactor built-in generators\n\n### Version 1.3 (2015-11-03) ###\n\n- Change `id_` property of generators to `id`\n\n\n### Version 2.0 (2017-02-26) ###\n\n- Icons reflect password strength\n- Alfred 3 only\n- Option to turn notifications off [#3][issue3]\n- Fix syntax error [#5][issue5]\n\n\n### Version 2.0.1 (2017-04-01) ###\n\n- Fix paste [#7][pr7]\n\n\n### Version 2.0.2 (2017-04-01) ###\n\n- Fix hanging background processes [#4][issue4]\n- New icons\n\n\n### Version 2.1 (2017-04-02) ###\n\n- Default to \"concealed\" copy so clipboard managers will ignore the passwords\n\n\n### Version 2.1.1 (2017-04-19) ###\n\n- Update dependencies\n\n\n### Version 2.1.2 (2017-12-10) ###\n\n- Update dependencies\n\n\n### Version 2.1.3 (2019-07-13) ###\n\n- Add Alfred 4 support\n\n\n[demo]: https://github.com/deanishe/alfred-pwgen/raw/master/demo.gif \"Alfred Password Generator Demo\"\n[gh-releases]: https://github.com/deanishe/alfred-pwgen/releases\n[packal]: http://www.packal.org/workflow/secure-password-generator\n[markov]: https://github.com/SimonSapin/snippets/blob/master/markov_passwords.py\n[gibberish]: http://stackoverflow.com/a/5502875/356942\n[entropy]: https://en.wikipedia.org/wiki/Entropy_(computing)\n[abcs]: https://docs.python.org/2.7/library/abc.html#module-abc\n[issue1]: https://github.com/deanishe/alfred-pwgen/issues/1\n[issue2]: https://github.com/deanishe/alfred-pwgen/issues/2\n[issue3]: https://github.com/deanishe/alfred-pwgen/issues/3\n[issue4]: https://github.com/deanishe/alfred-pwgen/issues/4\n[issue5]: https://github.com/deanishe/alfred-pwgen/issues/5\n[pr6]: https://github.com/deanishe/alfred-pwgen/pulls/6\n[pr7]: https://github.com/deanishe/alfred-pwgen/pulls/7\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanishe%2Falfred-pwgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeanishe%2Falfred-pwgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanishe%2Falfred-pwgen/lists"}