├── .gitattributes
├── .github
└── FUNDING.yml
├── .gitignore
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CREDITS.md
├── Dockerfile
├── LICENSE
├── README.md
├── assets
├── css
│ ├── dice.css
│ └── starter-template.css
├── img
│ ├── dice.jpg
│ ├── dude-chill-just-chill.gif
│ ├── qrcode.png
│ └── xkcd-password-strength.png
└── wordlist
│ ├── count_1w.txt
│ ├── create-wordlist.php
│ ├── eff_large_wordlist.txt
│ ├── go-create-wordlist.sh
│ ├── wordlist-5-dice-eff.js
│ ├── wordlist-5-dice.js
│ ├── wordlist-6-dice.js
│ ├── wordlist-7-dice.js
│ ├── wordlist-eff-5-dice-readme.txt
│ └── wordlist-eff-5-dice.txt
├── bin
├── docker-build.sh
├── docker-dev.sh
├── docker-prod.sh
├── docker-push.sh
├── get-cloudfront-cache-invalidations.sh
└── go-sync-to-s3.sh
├── cypress.config.js
├── cypress
├── .DS_Store
├── e2e
│ └── diceware.cy.js
├── fixtures
│ └── example.json
└── support
│ ├── commands.js
│ └── e2e.js
├── dist
├── bootstrap.min.css
├── bootstrap.min.js
├── bundle.js.LICENSE.txt
└── jquery.min.js
├── favicon.ico
├── fonts
└── glyphicons-halflings-regular.woff2
├── index.html
├── package-lock.json
├── package.json
├── robots.txt
├── src
├── dice.js
├── display.js
├── index.js
├── lib.js
├── util.js
└── wordlist.js
├── tests
├── lib.js
└── test.js
└── webpack.config.js
/.gitattributes:
--------------------------------------------------------------------------------
1 |
2 | src/index.js ident
3 |
4 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: dmuth
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Vim
3 | *.swp
4 |
5 | node_modules/
6 |
7 | dist/bundle.js
8 |
9 | diceware.zip
10 |
11 | # Don't check in videos of unit tests
12 | cypress/videos/
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 |
2 | language: node_js
3 | node_js:
4 | - "lts/*"
5 | - "15"
6 | - "14"
7 | - "13"
8 | - "12"
9 |
10 | #
11 | # Cache the node_modules directory
12 | #
13 | cache:
14 | directories:
15 | - "node_modules"
16 |
17 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at dmuth at dmuth DOT org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CREDITS.md:
--------------------------------------------------------------------------------
1 |
2 | - Emily Davenport: Caught some of my typos. :-)
3 | - GitHub user @atoponce: Noted that entropy was not at high as it should be, sent in a Pull Request, and provided valuable assistance
4 | for some UI issues that arose.
5 | - Arnold G. Reinhold: The original author of Diceware
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:20-bullseye-slim as builder
2 |
3 | RUN mkdir /tmp/diceware
4 | COPY . /tmp/diceware/
5 | WORKDIR /tmp/diceware
6 |
7 | RUN npm install && npm run build
8 |
9 | FROM nginx:1.25-bullseye
10 |
11 | COPY --from=builder /tmp/diceware/assets /usr/share/nginx/html/assets/
12 | COPY --from=builder /tmp/diceware/dist /usr/share/nginx/html/dist/
13 | COPY --from=builder /tmp/diceware/fonts /usr/share/nginx/html/fonts
14 | COPY --from=builder /tmp/diceware/favicon.ico /usr/share/nginx/html/favicon.ico
15 | COPY --from=builder /tmp/diceware/index.html /usr/share/nginx/html/index.html
16 | COPY --from=builder /tmp/diceware/robots.txt /usr/share/nginx/html/robots.txt
17 |
18 | RUN chmod -R a+rX /usr/share/nginx/html
19 |
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2015-2023 Douglas T. Muth
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Diceware
2 |
3 |
4 |
5 | Feel free to check out the live version at [https://diceware.dmuth.org/](https://diceware.dmuth.org/)
6 |
7 | Weak passwords are a big flaw in computer security due to a lack of "entropy" or randomness. For example, how many times have you used the name of a pet or relative or street in a password, or perhaps the number "1". Not very random, is it? :-) Worse still, if passwords are reused between services, that increases your security risk.
8 |
9 | Fact is, humans are terrible at remembering random combiations of letters and numbers, but we are great at remembering phrases of words. That's where Diceware comes in.
10 |
11 | Diceware is based on the proposal at [http://world.std.com/~reinhold/diceware.html](http://world.std.com/~reinhold/diceware.html) wherein virtual dice are roled 5 times, and the 5 digit number used against a lookup table of words. 4 dice rolls gives you 4 random words which are easy for a human being to remember, yet have a high amount of entropy which makes them hard to crack.
12 |
13 | For more information on Diceware:
14 | - [The Diceware Passphrase FAQ](http://world.std.com/~reinhold/diceware.html)
15 | - [Diceware word list](http://world.std.com/~reinhold/diceware.wordlist.asc)
16 | - [Diceware for Passphrase Generation and Other Cryptographic Applications](http://world.std.com/~reinhold/diceware.txt)
17 |
18 |
19 | # Can I run this on my own computer without using your website?
20 |
21 | Yes! Go to [https://github.com/dmuth/diceware/releases](https://github.com/dmuth/diceware/releases) and download the latest `diceware.zip` file.
22 | When you unzip that file, the contents will be written to a directory called `diceware/`. You
23 | can then point a webserver on your machine to `diceware/index.html` in order to use Diceware.
24 |
25 | Sadly, you cannot open `diceware/index.html` directly, as the CORS policy in Chrome prevents that.
26 | If you know of a way to fix that, please [open an issue](https://github.com/dmuth/diceware/issues). :-)
27 |
28 |
29 | # Will this work in an air-gapped environment?
30 |
31 | Yes, copies of assets such as Bootstrap and jQuery have been made, and Diceware is designed to be run without
32 | requiring an Internet connection.
33 |
34 |
35 | # Development
36 |
37 | This app is built with Webpack.
38 |
39 | When done editing `main.js`, the packed file can be built by simply running `webpack`
40 | on the command line. It will be writing to `dist/bundle.js`. To run webpack in a
41 | mode so that it regularly checks for changed files, run `webpack --watch --mode development`.
42 |
43 | In a move that departs from Best Practices, I have made the decision to include
44 | the packed file in Git. My reason for this is that the software will be ready
45 | to run as soon as it is checked out (or a ZIP is downloaded), and that is a key
46 | design feature of this app--I want it to be as easy to get up and running as possible.
47 |
48 | A local webserver can be set up by running `npm install http-server -g` to install it, then `http-server` to listen on http://localhost:8080/
49 |
50 | ## In summary:
51 |
52 | - Development
53 | - `npm run clean` - Cleanup after a previous run
54 | - `npm install` - Install NPM packages used by Diceware
55 | - `npm run dev-build` - Run webpack to pack Javascript files and watch for changes.
56 | - `http-server`
57 | - `vim src/lib.js src/index.js`
58 | - Be sure to check in your changes before the next step!
59 | - `ngrok http 8080` - Stand up an Ngrok endpoint
60 | - Paste that URL into [my QR Code Generator](https://httpbin.dmuth.org/qrcode/)
61 | - Scan the generated URL code on my iPhone and test from there.
62 | - Testing
63 | - `rm -fv src/index.js && git co src/index.js` - Get the new SHA1 hash that will be displayed in debug messages.
64 | - The hash can be crosschecked with the results of `git hash-object src/index.js`
65 | - `npm test` - Make sure you didn't break any of the core logic!
66 | - `npx cypress run` - Run front-end testing
67 | - If the tests break, run `npx cypress open` to run tests interactively.
68 | - Deployment
69 | - `npm run build` - Webpack Javscript files in production mode (smaller file but takes longer)
70 | - `./bin/go-sync-to-s3.sh` - Do this if you're me, to upload to S3. If you're not me, you'll need to do something else, or possibly nothing at all.
71 |
72 |
73 | ## In practice:
74 |
75 | - `npm run clean; npm run dev-build` - Run webpack in dev mode while working on Javascript
76 | - `http-server` - Stand up a local HTTP server
77 | - `vim src/lib.js src/index.js`
78 | - `rm -fv src/index.js && git co src/index.js`
79 | - `npm run clean; npm run build` - Run webpack in prod mode to produce final Javascript bundle
80 | - `./bin/go-sync-to-s3.sh` - Do this if you're me, to upload to S3. If you're not me, you'll need to do something else, or possibly nothing at all.
81 |
82 |
83 | ### Releasing a New Build
84 |
85 | - `npm run release-build` to create the ZIP file `diceware.zip` with all assets in it, including `bundle.js` and the contents of `node_modules/`.
86 | - `gh release create v1.0.1` to upload a release to https://github.com/dmuth/diceware/releases.
87 | - Change the tag for the version number accordingly.
88 | - `gh release upload v1.0.1 diceware.zip` to upload the ZIP file containing everything
89 |
90 |
91 | ## Development In Docker
92 |
93 | Wanna develop in Docker? We got you covered. Here are some helper scripts:
94 |
95 | - `bin/docker-build.sh` - Build the Docker copntainer
96 | - `bin/docker-dev.sh` - Run in dev mode--listening on http://localhost:8000/
97 | - `bin/docker-prod.sh` - Run in prod mode--listening on http://localhost:80/
98 | - `bin/docker-push.sh` - Push to Docker Hub
99 |
100 |
101 | ## Help Wanted
102 |
103 | I'm not much of a front-end dev these days, and my Javascript code is a little... unwieldly.
104 |
105 | If you have a solid understanding of front-end Javascript coding, and have any suggestions on how
106 | I can better architect things, feel free to give me a shout!
107 |
108 |
109 | # Who built this? / Contact
110 |
111 | My name is Douglas Muth, and I am a software engineer in Philadelphia, PA.
112 |
113 | There are several ways to get in touch with me:
114 | - Email to **doug.muth AT gmail DOT com** or **dmuth AT dmuth DOT org**
115 | - [Bluesky](https://dmuth.bsky.social/)
116 | - [LinkedIn](https://linkedin.com/in/dmuth)
117 |
118 | Feel free to reach out to me if you have any comments, suggestions, or bug reports.
119 |
120 |
--------------------------------------------------------------------------------
/assets/css/dice.css:
--------------------------------------------------------------------------------
1 |
2 | .die {
3 | width: 100px;
4 | height: 100px;
5 | background: #ff1111;
6 | border-radius: 10px;
7 | margin-left: 20px;
8 | margin-bottom: 20px;
9 | }
10 |
11 | .dot {
12 | position:absolute;
13 | width: 18px;
14 | height: 18px;
15 | border-radius: 18px;
16 | background: white;
17 | box-shadow: inset 5px 0 10px white;
18 | }
19 |
20 | .dot.center {
21 | /* Orders of margins are: top right bottom left */
22 | margin: 39px 0 0 41px;
23 | }
24 |
25 | .dot.dtop {
26 | margin-top: 14px;
27 | }
28 |
29 | .dot.dleft {
30 | margin-left: 65px;
31 | }
32 |
33 | .dot.dright {
34 | margin-left: 16px;
35 | }
36 |
37 | .dot.dbottom {
38 | margin-top: 63px;
39 | }
40 |
41 | .dot.center.dleft {
42 | margin: 38px 0 0 16px;
43 | }
44 |
45 | .dot.center.dright {
46 | margin: 38px 0 0 65px;
47 | }
48 |
49 | .responsive {
50 | width: 100%;
51 | max-width: 740px;
52 | height: auto;
53 | }
54 |
55 | .responsive-qrcode {
56 | width: 100%;
57 | max-width: 300px;
58 | height: auto;
59 | }
60 |
61 |
62 |
--------------------------------------------------------------------------------
/assets/css/starter-template.css:
--------------------------------------------------------------------------------
1 |
2 | body {
3 | padding-top: 50px;
4 | }
5 | .starter-template {
6 | padding: 0px 15px;
7 | text-align: center;
8 | }
9 |
10 | .results_words_key, .results_words_value,
11 | .results_phrase_key, .results_phrase_value,
12 | .results_num_possible_key, .results_num_possible_value,
13 | .dice_word
14 | {
15 | font-size: x-large;
16 | }
17 |
18 | .btn.dice_button {
19 | margin-left: 5px;
20 | margin-bottom: 5px;
21 | }
22 |
23 | .dice_num {
24 | margin-top: 0px;
25 | }
26 |
27 | .main {
28 | /* No idea why this defaulted to 14, but I'm fixing it here. */
29 | font-size: 16px;
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/assets/img/dice.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmuth/diceware/419a9d26673098eb4fbb786f007742603f5c16d4/assets/img/dice.jpg
--------------------------------------------------------------------------------
/assets/img/dude-chill-just-chill.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmuth/diceware/419a9d26673098eb4fbb786f007742603f5c16d4/assets/img/dude-chill-just-chill.gif
--------------------------------------------------------------------------------
/assets/img/qrcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmuth/diceware/419a9d26673098eb4fbb786f007742603f5c16d4/assets/img/qrcode.png
--------------------------------------------------------------------------------
/assets/img/xkcd-password-strength.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmuth/diceware/419a9d26673098eb4fbb786f007742603f5c16d4/assets/img/xkcd-password-strength.png
--------------------------------------------------------------------------------
/assets/wordlist/create-wordlist.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | 7) {
69 | printSyntax($progname);
70 | }
71 |
72 | } else if (!isset($retval["eff"])) {
73 | printSyntax($progname);
74 |
75 | }
76 |
77 | return($retval);
78 |
79 | } // End of parseArgs()
80 |
81 |
82 | /**
83 | * Read in our wordlist from Google and return an array with all words that
84 | * passed validation.
85 | *
86 | * @param string $filename The filename
87 | *
88 | * @param integer $dice How many dice rolls to make? This number will
89 | * be between 5 and 8, inclusive.
90 | *
91 | * @return array An array of words
92 | *
93 | */
94 | function readWordListPeterNorvig($filename, $dice) {
95 |
96 | $retval = array();
97 |
98 | $fp = @fopen($filename, "r");
99 | if (!$fp) {
100 | throw new Exception("Could not open '$filename' for reading");
101 | }
102 |
103 | $count = 0;
104 | $max_count = array(
105 | 5 => 7776,
106 | 6 => 46656,
107 | 7 => 279936,
108 | //8 => 1679616, // Can't do this with only 1/3rd million words ATM.
109 | );
110 |
111 | //
112 | // We will tweak acceptable word length based on the number of
113 | // dice we are rolling so we get enough words.
114 | //
115 | $word_lengths = array(
116 | 5 => array("min" => 4, "max" => 7),
117 | 6 => array("min" => 5, "max" => 6),
118 | 7 => array("min" => 4, "max" => 11),
119 | );
120 |
121 | while ($line = fgets($fp)) {
122 |
123 | $line = rtrim($line);
124 | list($word, $freq) = explode("\t", $line);
125 | $len = strlen($word);
126 |
127 | if ($len < $word_lengths[$dice]["min"] || $len > $word_lengths[$dice]["max"]) {
128 | continue;
129 | }
130 |
131 | $retval[] = $word;
132 |
133 | $count++;
134 |
135 | if ($count > $max_count[$dice]) {
136 | break;
137 | }
138 |
139 | }
140 |
141 | //
142 | // Put the words in alphabetical order for my own sanity.
143 | //
144 | sort($retval);
145 |
146 | fclose($fp);
147 |
148 | return($retval);
149 |
150 | } // End of readWordListPeterNorvig()
151 |
152 |
153 | /**
154 | * Read in the EFF's wordlist and return an array with all the words.
155 | *
156 | * @param string $filename The filename
157 | *
158 | * @return array An array of words
159 | *
160 | */
161 | function readWordListEff($filename) {
162 |
163 | $retval = array();
164 |
165 | $fp = @fopen($filename, "r");
166 | if (!$fp) {
167 | throw new Exception("Could not open '$filename' for reading");
168 | }
169 |
170 | while ($line = fgets($fp)) {
171 |
172 | $line = rtrim($line);
173 | list($roll, $word) = explode("\t", $line);
174 |
175 | $retval[] = $word;
176 |
177 | }
178 |
179 | //
180 | // Put the words in alphabetical order for my own sanity.
181 | //
182 | sort($retval);
183 |
184 | fclose($fp);
185 |
186 | return($retval);
187 |
188 | } // End of readWordListEff()
189 |
190 |
191 | /**
192 | * Create our Javascript, but as an array
193 | *
194 | * @param array $words Our array of words
195 | *
196 | * @param array $param Our array of params
197 | *
198 | * @return string Javascript which defines an array of those words
199 | */
200 | function getJsArray($words, $params) {
201 |
202 | $url = "(unknown)";
203 |
204 | if (isset($params["dice"])) {
205 | $url = "http://norvig.com/ngrams/";
206 |
207 | } else if (isset($params["eff"])) {
208 | $url = "https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases";
209 |
210 | }
211 |
212 |
213 | $retval = ""
214 | . "//\n"
215 | . "// Our wordlist.\n"
216 | . "//\n"
217 | . "// Originally obtained from: $url\n"
218 | . "//\n"
219 | . "var wordlist = [\n"
220 | ;
221 |
222 | $beenhere = false;
223 | foreach ($words as $key => $value) {
224 |
225 | if ($beenhere) {
226 | $retval .= ",\n";
227 | }
228 |
229 | $retval .= "\t\"${value}\"";
230 |
231 | $beenhere = true;
232 |
233 | }
234 |
235 | $retval .= "\n"
236 | . "];\n"
237 | . "\n"
238 | ;
239 |
240 | return($retval);
241 |
242 | } // End of getJsArray()
243 |
244 |
245 | /**
246 | * Our main entry point.
247 | */
248 | function main($argv) {
249 |
250 | $params = parseArgs($argv);
251 | //print_r($params); // Debugging
252 |
253 | //
254 | // Read our file
255 | //
256 | if (isset($params["dice"])) {
257 | $filename = "count_1w.txt";
258 | $words = readWordListPeterNorvig($filename, $params["dice"]);
259 | //print_r($words); // Debugging
260 |
261 | } else if (isset($params["eff"])) {
262 | //
263 | // Handle wordllist from https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt
264 | //
265 | $filename = "eff_large_wordlist.txt";
266 | $words = readWordListEff($filename);
267 | //print_r($words); // Debugging
268 |
269 | }
270 |
271 |
272 | //
273 | // Get our Javascript
274 | //
275 | $js = getJsArray($words, $params);
276 |
277 | print $js;
278 |
279 | } // End of main()
280 |
281 |
282 | main($argv);
283 |
284 |
285 |
--------------------------------------------------------------------------------
/assets/wordlist/go-create-wordlist.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Wrapper to create our wordlist from any directory
4 | #
5 |
6 | # Errors fatal
7 | set -e
8 |
9 | pushd $(dirname $0) > /dev/null
10 |
11 |
12 | JS="wordlist-5-dice.js"
13 | echo "# "
14 | echo "# Creating wordlist '$JS'..."
15 | echo "# "
16 | ./create-wordlist.php --dice 5 > ${JS}
17 |
18 | JS="wordlist-6-dice.js"
19 | echo "# "
20 | echo "# Creating wordlist '$JS'..."
21 | echo "# "
22 | ./create-wordlist.php --dice 6 > ${JS}
23 |
24 | JS="wordlist-7-dice.js"
25 | echo "# "
26 | echo "# Creating wordlist '$JS'..."
27 | echo "# "
28 | ./create-wordlist.php --dice 7 > ${JS}
29 |
30 | JS="wordlist-5-dice-eff.js"
31 | echo "# "
32 | echo "# Creating EFF 5-dice Wordlist..."
33 | echo "# "
34 | ./create-wordlist.php --eff > ${JS}
35 |
36 | echo "# "
37 | echo "# Done!"
38 | echo "# "
39 |
40 |
41 |
--------------------------------------------------------------------------------
/assets/wordlist/wordlist-eff-5-dice-readme.txt:
--------------------------------------------------------------------------------
1 | Originally obtained from: https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases
2 |
3 |
--------------------------------------------------------------------------------
/bin/docker-build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Build our Docker image.
4 | #
5 |
6 | # Errors are fatal
7 | set -e
8 |
9 | # Change to the parent directory of this script
10 | pushd $(dirname $0)/.. > /dev/null
11 |
12 | docker build -t diceware . -f ./Dockerfile
13 |
14 |
--------------------------------------------------------------------------------
/bin/docker-dev.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Script to run the script in dev mode, which will spawn a shell
4 | #
5 |
6 | # Errors are fatal
7 | set -e
8 |
9 | # Change to the parent directory
10 | pushd $(dirname $0)/.. > /dev/null
11 |
12 | PORT=${PORT:=8000}
13 |
14 | docker run --rm -it -p ${PORT}:80 -v $(pwd):/mnt diceware
15 |
16 |
17 |
--------------------------------------------------------------------------------
/bin/docker-prod.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Script to run the script in prod mode
4 | #
5 |
6 | # Errors are fatal
7 | set -e
8 |
9 | # Change to the parent directory
10 | pushd $(dirname $0)/.. > /dev/null
11 |
12 | docker run --rm -p 80:80 diceware
13 |
14 |
--------------------------------------------------------------------------------
/bin/docker-push.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Push our Docker image our Docker Hub.
4 | #
5 |
6 | # Errors are fatal
7 | set -e
8 |
9 | # Change to the parent directory of this script
10 | pushd $(dirname $0)/.. > /dev/null
11 |
12 | docker tag diceware dmuth1/diceware
13 | docker push dmuth1/diceware
14 |
15 |
16 |
--------------------------------------------------------------------------------
/bin/get-cloudfront-cache-invalidations.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This script lists Cloudfront invalidations for a given distribution ID.
4 | #
5 |
6 | # Errors are fatal
7 | set -e
8 |
9 | ID=""
10 | if test ! "$1"
11 | then
12 | echo "! "
13 | echo "! Syntax: $0 ID"
14 | echo "! "
15 | exit 1
16 | fi
17 |
18 | ID=$1
19 |
20 | aws cloudfront list-invalidations \
21 | --distribution-id ${ID} \
22 | --query "InvalidationList.Items[*].[Id,CreateTime,Status]" \
23 | --output text
24 |
25 |
--------------------------------------------------------------------------------
/bin/go-sync-to-s3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Sync up all of our files to the S3 bucket
4 | #
5 |
6 | # Errors are fatal
7 | set -e
8 |
9 | pushd $(dirname $0)/.. > /dev/null
10 |
11 | echo "# Syncing files to AWS S3 bucket..."
12 | aws s3 sync . s3://diceware.dmuth.org/ --exclude ".*" --exclude "node_modules/*" --delete
13 |
14 | HOSTNAME="diceware.dmuth.org"
15 | ID=$(aws cloudfront list-distributions \
16 | --query "DistributionList.Items[?Aliases.Items[?contains(@, '${HOSTNAME}')]]" \
17 | | jq -r .[].Id)
18 |
19 | if test ! "${ID}"
20 | then
21 | echo "! No CloudFront distribution ID found, something has gone wrong. Aborting!"
22 | exit 1
23 | fi
24 |
25 | echo "# Found Cloudfront distribution ID: ${ID}"
26 |
27 | echo "# Invalidating cache... "
28 | aws cloudfront create-invalidation --distribution-id ${ID} --paths "/*"
29 |
30 | echo "# Getting current invalidations..."
31 | echo
32 | ./bin/get-cloudfront-cache-invalidations.sh ${ID} | head -n5
33 | echo
34 |
35 | echo "# "
36 | echo "# To keep track of invalidation status so you know when complete, run this command:"
37 | echo "# ./bin/get-cloudfront-cache-invalidations.sh ${ID} | head -n5"
38 | echo "# "
39 |
40 | echo "# Done!"
41 |
42 |
--------------------------------------------------------------------------------
/cypress.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // The rest of the Cypress config options go here...
3 | projectId: "ot9ks7",
4 |
5 | defaultCommandTimeout: 10000,
6 |
7 | e2e: {
8 | baseUrl: "http://localhost:8081",
9 | setupNodeEvents(on, config) {
10 | // implement node event listeners here
11 | },
12 | },
13 | };
14 |
--------------------------------------------------------------------------------
/cypress/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmuth/diceware/419a9d26673098eb4fbb786f007742603f5c16d4/cypress/.DS_Store
--------------------------------------------------------------------------------
/cypress/e2e/diceware.cy.js:
--------------------------------------------------------------------------------
1 |
2 | describe('Diceware', () => {
3 |
4 | it('Roll 2 dice and check results', () => {
5 |
6 | cy.visit('/');
7 |
8 | cy.get('[data-test="button-2"]').click();
9 | cy.get('[data-test="button"]').click();
10 |
11 | cy.get('.results > .results_phrase_key').should("exist").contains("passphrase");
12 |
13 | cy.get('[data-test-num-dice]')
14 | .should("exist")
15 | .contains(2)
16 | ;
17 |
18 | })
19 |
20 | it('Roll 4 dice and check results', () => {
21 |
22 | cy.visit('/');
23 |
24 | cy.get('[data-test="button-4"]').click();
25 | cy.get('[data-test="button"]').click();
26 |
27 | cy.get('.results > .results_phrase_key').should("exist").contains("passphrase");
28 |
29 | cy.get('[data-test-num-dice]')
30 | .should("exist")
31 | .contains(4)
32 | ;
33 |
34 | })
35 |
36 |
37 | })
38 |
--------------------------------------------------------------------------------
/cypress/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io",
4 | "body": "Fixtures are a great way to mock data for responses to routes"
5 | }
6 |
--------------------------------------------------------------------------------
/cypress/support/commands.js:
--------------------------------------------------------------------------------
1 | // ***********************************************
2 | // This example commands.js shows you how to
3 | // create various custom commands and overwrite
4 | // existing commands.
5 | //
6 | // For more comprehensive examples of custom
7 | // commands please read more here:
8 | // https://on.cypress.io/custom-commands
9 | // ***********************************************
10 | //
11 | //
12 | // -- This is a parent command --
13 | // Cypress.Commands.add('login', (email, password) => { ... })
14 | //
15 | //
16 | // -- This is a child command --
17 | // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18 | //
19 | //
20 | // -- This is a dual command --
21 | // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22 | //
23 | //
24 | // -- This will overwrite an existing command --
25 | // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
--------------------------------------------------------------------------------
/cypress/support/e2e.js:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/e2e.js is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands'
18 |
19 | // Alternatively you can use CommonJS syntax:
20 | // require('./commands')
--------------------------------------------------------------------------------
/dist/bootstrap.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.3.4 (http://getbootstrap.com)
3 | * Copyright 2011-2015 Twitter, Inc.
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 | */
6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.4",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.4",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.4",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.4",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('
45 | Generate high-entropy passwords the easy way! 46 |
47 | 48 | 49 | 51 | 121 | 122 |258 | The NIST has since released new password creation guidelines in a document which is rather lengthly, but summarized nicely here. 259 |
260 | 261 |264 | Nope, even the best password in the world won't protect you if it is phished. However, having a password unique to that service will help mitigate the harm. Two Factor Authentication will also help you. 265 |
266 | 267 | 268 |271 | Sure! Here's a handy QR Code that your friends can scan: 272 |
273 | 274 | 277 | 278 |279 | Yes, I created that with my own QR Code Generator. 280 | In the tech industry, we call this dogfooding. :-) 281 |
282 | 283 | 284 |350 | For rolls of 5 dice, I am now using the worldlist from the EFF. Substantial enhancements have been made over the original list designed to improve usability without compromising security. 352 |
353 | 354 |355 | I started off using the original wordlist, 356 | but it contained a lot of symbols, punctuation, numbers, and 2 and 3 letter words that felt made 357 | the passwords it generated more difficult to remember. 358 | 359 |
360 | 361 |364 | The default is 5 dice, which allows for 7,776 different words per roll. 365 | 366 | I used to have functionality for 6 and 7 dice per word, that involved longer wordlists 367 | and the words became increasingly obscure. I decided to remove that functionality because 368 | I felt it made the product harder to use and less accessible to the typical user. 369 |
370 | 371 |421 | Yep! I've built a few things you may find interesting: 422 |
423 | 424 |