Showing preview only (3,915K chars total). Download the full file or copy to clipboard to get everything.
Repository: atoponce/webpassgen
Branch: master
Commit: 85f6d3e3d1b2
Files: 108
Total size: 2.9 MB
Directory structure:
gitextract_8cl0tsvt/
├── .gitignore
├── COPYING.md
├── FEATURES.md
├── LICENSE.md
├── README.md
├── assets/
│ └── style.css
├── bookmarklets.html
├── entropy.html
├── index.html
├── js/
│ ├── alternate.js
│ ├── cryptocurrency.js
│ ├── diceware.js
│ ├── eff.js
│ ├── main.js
│ ├── pseudowords.js
│ ├── randogram.js
│ └── random.js
├── lists/
│ ├── alternateAF.js
│ ├── alternateBE.js
│ ├── alternateColors.js
│ ├── alternateDeseret.js
│ ├── alternateElvish.js
│ ├── alternateEyeware.js
│ ├── alternateHR.js
│ ├── alternateKlingon.js
│ ├── alternateMN.js
│ ├── alternateObscure.js
│ ├── alternatePgp.js
│ ├── alternatePokerware.js
│ ├── alternateSR.js
│ ├── alternateShavian.js
│ ├── alternateSimpsons.js
│ ├── alternateSkey.js
│ ├── alternateTrump.js
│ ├── alternateUK.js
│ ├── alternateVAN.js
│ ├── alternateWordle.js
│ ├── alternateZxcvbn.js
│ ├── bitcoinCNSimp.js
│ ├── bitcoinCNTrad.js
│ ├── bitcoinCZ.js
│ ├── bitcoinEN.js
│ ├── bitcoinES.js
│ ├── bitcoinFR.js
│ ├── bitcoinIT.js
│ ├── bitcoinJP.js
│ ├── bitcoinKR.js
│ ├── bitcoinPT.js
│ ├── dicewareBG.js
│ ├── dicewareBeale.js
│ ├── dicewareCA.js
│ ├── dicewareCN.js
│ ├── dicewareCZ.js
│ ├── dicewareDA.js
│ ├── dicewareDE.js
│ ├── dicewareEL.js
│ ├── dicewareEN.js
│ ├── dicewareEO.js
│ ├── dicewareES.js
│ ├── dicewareET.js
│ ├── dicewareEU.js
│ ├── dicewareFI.js
│ ├── dicewareFR.js
│ ├── dicewareHU.js
│ ├── dicewareIT.js
│ ├── dicewareIW.js
│ ├── dicewareJP.js
│ ├── dicewareLA.js
│ ├── dicewareMI.js
│ ├── dicewareNL.js
│ ├── dicewareNLP.js
│ ├── dicewareNO.js
│ ├── dicewarePL.js
│ ├── dicewarePT.js
│ ├── dicewareRO.js
│ ├── dicewareRU.js
│ ├── dicewareSK.js
│ ├── dicewareSL.js
│ ├── dicewareSV.js
│ ├── dicewareTR.js
│ ├── effDistant.js
│ ├── effGameOfThrones.js
│ ├── effHarryPotter.js
│ ├── effLong.js
│ ├── effShort.js
│ ├── effStarTrek.js
│ ├── effStarWars.js
│ ├── extra/
│ │ ├── README.md
│ │ ├── alternateDeseret_lowercase.js
│ │ ├── alternate_colors_full.js
│ │ └── alternate_trump_full.js
│ ├── moneroCN.js
│ ├── moneroDE.js
│ ├── moneroEN.js
│ ├── moneroEO.js
│ ├── moneroES.js
│ ├── moneroFR.js
│ ├── moneroIT.js
│ ├── moneroJBO.js
│ ├── moneroJP.js
│ ├── moneroNL.js
│ ├── moneroPT.js
│ ├── moneroRU.js
│ ├── pseudoBigrams.js
│ ├── pseudoDibels.js
│ └── randomEmoji.js
├── manifest.json
└── mightytiny.html
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.swp
tmp
================================================
FILE: COPYING.md
================================================
**Copyrights of other files used in this project**:
`/assets/twemoji.woff2` is a WOFF2 implementation of the [Mozilla twemoji-colr
TrueType font][1]. twemoji-colr is licensed under the Apache License, Version
2.0. See the project's [LICENSE.md][2] for more information.
[1]: https://github.com/mozilla/twemoji-colr
[2]: https://github.com/mozilla/twemoji-colr/blob/master/LICENSE.md
================================================
FILE: FEATURES.md
================================================
# Features
This password generator project consists of three families of generators:
1. Passphrases
2. Pseudowords (memorable or pronounceable)
3. Random meaningless strings
Random meaningless strings are the gold standard, and a common homework assignment problem by many
computer science teacher in college or university. They great for density, and when coupled with a
password manager, only need to be copied and pasted without concern about recalling it or needing to
type it out. However, they can be cumbersome when needing to type it out, such as when in a
data center or on a mobile device. However, they'll generally meet stringent password strength
requirements, and they're generally short with high security per character.
Passphrases are tried and true, and a favorite of many. Unfortunately, some of the word lists the
passphrases are based on are not organized very well, so homonyms, plurals, and other concerns
arise, in addition to usually being subject or noun heavy. Some word lists, like those provided by
the EFF or Bitcoin have more attention placed on such concerns, and usually provide higher quality
lists. Word lists like those provided by "Simpsons" or "Trump" are based on sources of natural
speaking, so they tend to have a better balance in nouns, adjectives, verbs, etc.
Pseudowords sit between random meaningless strings and passphrases to provide a balance of density
and memorability without complexity. Pseudowords generally try to be pronounceable by alternating
consonant and vowel letters. Unfortunately, the pseudowords are usually non-words, and even though
they might be pronounceable, they are probably still meaningless. Other pseudowords try to be more
memorable rather than pronounceable, such as "Letterblock Diceware" which uses bigram weighting to
generate the string. Regardless, they attempt to "meet in the middle" between the density and
complexity of random meaningless strings, and the convenience of being pronounceable, ease of typing
on the keyboard, and memorability of passphrases.
Those three families of generators are broken down into six general categories:
1. Alternate: A selection of different approaches to passphrase generation.
2. Bitcoin: All [officially defined][1] BIP 0039 language word lists.
3. Diceware: All [officially defined][2] word lists.
4. EFF: The [official lists][3] provided by the EFF and [unofficial lists][4] corrected by me.
5. Pseudowords: A selection of different approaches to pseudoword generation.
6. Random: Some common numerical bases
[1]: https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md
[2]: https://diceware.com
[3]: https://www.eff.org/dice
[4]: https://gist.github.com/atoponce/03109c0a51aededbddaf40b4c0aa0d7d/
Below is a list of the features that this project supports, with the various generators that supply
each feature. Note that many generators have multiple features.
## Mouse Entropy Collection
The project supports collecting entropy via mouse or finger movement over an animated CSPRNG noise
matrix. These bits are debiased and stored locally for mixing into the password generation if you
choose. This should yield "true random" passwords, providing information theoretic security like
flipping fair coins or tossing fair dice.
## Checksums
Client-side software could check the validity of the checksum first before sending it to the
authentication server for hashing. This should reduce stress off the authentication server by
preventing hashing of wrong passwords.
* Bitcoin
* Pseudowords: Bubble Babble, Letterblock Diceware
* Random: Base32
## Educational Discussion
Passphrases from a deck of playing cards? Twitter? Simpsons episodes? Leaked passwords? These
generators are designed to spark a discussion about the security of how passphrases can be sourced.
* Alternate: English (All), Pokerware, RockYou, Simpsons, Trump
* Diceware: English (Beale), English (NLP)
## Encoding Standards
Each of these is a common (more or less) standard for converting binary into text. In the case of
Munemo, it's converting a signed integer into a signed base100 pronounceable string.
* Pseudowords: Bubble Babble, Munemo
* Random: Base85, Base64, Base58, Base32, Base16
## Entertainment
These are here for strictly entertainment purposes. Who says you can't have some fun with your
passwords? Personally, I find it entertaining to have a password out of Braille, as it's designed
for tactile use, not visual use.
* Alternate: Elvish, Klingon
* EFF: Game of Thrones, Harry Potter, Star Trek, Star Wars
* Random: Braille, Emoji
## Density
Just categorizes character density for the same security level into high, medium, and low.
### High
* Pseudowords: Letterblock Diceware
* Random: Base94 - Base52
* Random: Braille, Emoji, ISO 8859-1, Latin Extended
### Medium
* Pseudowords: Apple, Inc.
* Random: Base36 - Base16
### Low
* Alternate
* Bitcoin
* Diceware
* EFF
* Pseudowords: Bubble Babble, Munemo, Proquints
## Meets Complex Requirements
Sites that have very complex password strength requirements could probably be satisfied with these
generators. It may take a couple generations for the site to accept it however.
* Pseudowords: Apple, Inc, Letterblock Diceware
* Random: Base94, Base85
## More Natural English Grammar
One problem with passphrases is their lack of language structure. These generators attempt either
implicitly or explicitly to crease passphrases that seem more "natural", in hopes of making them
easier to recall from memory.
* Alternate: Simpsons, Trump
* Diceware: English (NLP)
## Multiple Languages
One of the core requirements of my passphrase generators was to support as many languages as
possible to have the largest outreach. That includes the nerds with their artificial languages.
* Alternate: Elvish, Klingon
* Bitcoin
* Diceware
## Programmatic Predictability
In the client-side software, if enough of the characters are typed to uniquely identify a word, the
software could auto-complete it for the user, speeding up the process of logging and reducing the
likelihood of errors.
* Alternate: PGP, S/KEY
* Bitcoin
* EFF: Distant Words
## Synaesthesia
This is entirely an unfounded investigation into whether or not seeing the color of the color word
itself will help in remembering that word, and ultimately the passphrase. For those with diagnosed
synaesthesia, I would be very interested in hearing from you if this helped where you struggled with
generic passphrase approaches, such as Diceware.
* Alternate: Colors
## Unicode
Bytes are bytes, and Unicode characters are just more bytes. This can be an effective way to test
authentication systems for localization support, run dynamic tests for bugs, and other things.
* Alternate: English (Deseret), English (Shavian)
* Bitcoin
* Diceware
* Random: Braille, Emoji, ISO 8859-1, Latin Extended
## Verbal Unambiguity
Sometimes a password needs to be spoken in a noisy environment, such as a PGP key signing party or
in a data center. These word lists are designed such that each word has its own distinct sound.
* Alternate: PGP, S/KEY
## Visual Unambiguity
As with verbal unambiguity, these are visually unambiguous, even you might need to know the
character set in advance. They should read from screens or printed documents without confusion.
* Alternate: Colors
* Random: Base32 - Base2, Coin Flips, DNA Sequence
================================================
FILE: LICENSE.md
================================================
GNU Affero General Public License
=================================
_Version 3, 19 November 2007_
_Copyright © 2007 Free Software Foundation, Inc. <<http://fsf.org/>>_
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
## Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: **(1)** assert copyright on the software, and **(2)** offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
## TERMS AND CONDITIONS
### 0. Definitions
“This License” refers to version 3 of the GNU Affero General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this
License. Each licensee is addressed as “you”. “Licensees” and
“recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a “modified version” of the
earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based
on the Program.
To “propagate” a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices”
to the extent that it includes a convenient and prominently visible
feature that **(1)** displays an appropriate copyright notice, and **(2)**
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
### 1. Source Code
The “source code” for a work means the preferred form of the work
for making modifications to it. “Object code” means any non-source
form of a work.
A “Standard Interface” means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other
than the work as a whole, that **(a)** is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and **(b)** serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
“Major Component”, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
### 2. Basic Permissions
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
### 4. Conveying Verbatim Copies
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
### 5. Conveying Modified Source Versions
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
* **a)** The work must carry prominent notices stating that you modified
it, and giving a relevant date.
* **b)** The work must carry prominent notices stating that it is
released under this License and any conditions added under section 7.
This requirement modifies the requirement in section 4 to
“keep intact all notices”.
* **c)** You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
* **d)** If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
“aggregate” if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
### 6. Conveying Non-Source Forms
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
* **a)** Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
* **b)** Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either **(1)** a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or **(2)** access to copy the
Corresponding Source from a network server at no charge.
* **c)** Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
* **d)** Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
* **e)** Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A “User Product” is either **(1)** a “consumer product”, which means any
tangible personal property which is normally used for personal, family,
or household purposes, or **(2)** anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, “normally used” refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
“Installation Information” for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
### 7. Additional Terms
“Additional permissions” are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
* **a)** Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
* **b)** Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
* **c)** Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
* **d)** Limiting the use for publicity purposes of names of licensors or
authors of the material; or
* **e)** Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
* **f)** Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered “further
restrictions” within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
### 8. Termination
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated **(a)**
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and **(b)** permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
### 9. Acceptance Not Required for Having Copies
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
### 10. Automatic Licensing of Downstream Recipients
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
### 11. Patents
A “contributor” is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, “control” includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To “grant” such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either **(1)** cause the Corresponding Source to be so
available, or **(2)** arrange to deprive yourself of the benefit of the
patent license for this particular work, or **(3)** arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. “Knowingly relying” means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is “discriminatory” if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license **(a)** in connection with copies of the covered work
conveyed by you (or copies made from those copies), or **(b)** primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
### 12. No Surrender of Others' Freedom
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
### 13. Remote Network Interaction; Use with the GNU General Public License
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
### 14. Revised Versions of this License
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License “or any later version” applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
### 15. Disclaimer of Warranty
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
### 16. Limitation of Liability
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
### 17. Interpretation of Sections 15 and 16
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
_END OF TERMS AND CONDITIONS_
## How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the “copyright” line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a “Source” link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a “copyright disclaimer” for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<<http://www.gnu.org/licenses/>>.
================================================
FILE: README.md
================================================
# Web-based Password Generator
This is a simple web-based password generator which uses 6-different styles
of passwords that can fit personal preferences, or restrictions from
websites that require the password in a certain format.
Everything is calculated in JavaScript locally, and the passwords are not
sent to the server for logging. You should be able to download this code,
and run it offline, if you're truly paranoid.
The project takes advantage of `localStorage` to save state across browser
sessions. This is needed to keep track of which security level you prefer when
generating and passwords, and if using the mouse entropy generator, saving the
debiased true random data. `localStorage` is not a cookie and is never
communicated with a web server.
## Desktop Screenshots
<table style="border-collapse: collapse; border: 1px solid black;">
<tr><td style="border: 1px solid black;">
<img alt="Desktop main generator screenshot" src="https://user-images.githubusercontent.com/699572/240378653-a0e388be-69b5-46fb-83bc-3d061fe20d4c.png" />
</td><td style="border: 1px solid black;">
<img alt="Desktop mouse entropy screenshot" src="https://user-images.githubusercontent.com/699572/240378656-abaa1a2b-cf67-4cec-8eb5-d938581cf5e5.png" />
</td></tr></table>
## Mobile-Friendly Screenshots
<table style="border-collapse: collapse; border: 1px solid black;">
<tr><td style="border: 1px solid black;">
<img alt="Light theme mobile screenshot" src="https://user-images.githubusercontent.com/699572/240378645-b3ba8d5d-0f58-4406-8c97-708b624da5f1.png" />
</td><td style="border: 1px solid black;">
<img alt="Dark theme mobile screenshot" src="https://user-images.githubusercontent.com/699572/179523337-f6f3cc5a-f48f-4274-94f8-de48fe1be3f4.png" />
</td></tr></table>
## Supported Languages
Here is the full breakdown of language support across the passphrase generators:
[comment]: <> (Ignore the table column formatting in the table below. It sucks in Vim, but looks great in Visual Studio Code)
| ID | ISO | Language | Unique | Alt. | Bit. | Mon. | Dice | EFF | Notes |
|:--:|:---:|:-----------|:------:|:----:|:----:|:----:|:----:|:---:|:-----------------------------------|
| 1 | -- | Elvish | 7,776 | ✔️ | | | | | |
| 2 | -- | Klingon | 2,604 | ✔️ | | | | | |
| 3 | AF | Afrikaans | 6,567 | ✔️ | | | | | |
| 4 | BE | Belrusian | 5,676 | ✔️ | | | | | |
| 5 | BG | Bulgarian | 7,776 | | | | ✔️ | | List by Assen Vassilev |
| 6 | CA | Catalan | 7,776 | | | | ✔️ | | |
| 7 | CN | Chinese | var. | | ✔️ | ✔️ | ✔️ | | |
| 8 | CZ | Czech | var. | | ✔️ | | ✔️ | | |
| 9 | DA | Danish | 7,776 | | | | ✔️ | | |
| 10 | DE | German | 1,626 | | | ✔️ | ✔️ | | |
| 11 | EL | Greek | 7,776 | | | | ✔️ | | |
| 12 | EN | English | var. | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
| 13 | EO | Esperanto | var. | | | ✔️ | ✔️ | | |
| 14 | ES | Spanish | var. | | ✔️ | ✔️ | ✔️ | | |
| 15 | ET | Estonian | 7,776 | | | | ✔️ | | |
| 16 | EU | Basque | 7,776 | | | | ✔️ | | |
| 17 | FI | Finnish | 7,776 | | | | ✔️ | | |
| 18 | FR | French | var. | | ✔️ | ✔️ | ✔️ | | |
| 19 | HR | Croatian | 9,204 | ✔️ | | | | | |
| 20 | HU | Hungarian | 7,776 | | | | ✔️ | | |
| 21 | IT | Italian | var. | | ✔️ | ✔️ | ✔️ | | |
| 22 | IW | Hebrew | 7,776 | | | | ✔️ | | |
| 23 | JBO | Lojban | 1,626 | | | ✔️ | | | |
| 24 | JP | Japanese | var. | | ✔️ | ✔️ | ✔️ | | |
| 25 | KO | Korean | 2,048 | | ✔️ | | | | |
| 26 | LA | Latin | 7,776 | | | | ✔️ | | |
| 27 | MI | Maori | 7,776 | | | | ✔️ | | |
| 28 | MN | Mongolian | 4,124 | ✔️ | | | | | |
| 29 | NL | Dutch | var. | | | ✔️ | ✔️ | | Alternate composite |
| 30 | NO | Norwegian | 7,776 | | | | ✔️ | | |
| 31 | PL | Polish | 7,776 | | | | ✔️ | | |
| 32 | PT | Portuguese | var. | | ✔️ | ✔️ | ✔️ | | |
| 33 | RO | Romanian | 7,776 | | | | ✔️ | | |
| 34 | RU | Russian | var. | | | ✔️ | ✔️ | | |
| 35 | SK | Slovak | 7,776 | | | | ✔️ | | |
| 36 | SL | Slovenian | 7,776 | | | | ✔️ | | |
| 37 | SR | Serbian | 8,670 | ✔️ | | | | | |
| 38 | SV | Swedish | 7,776 | | | | ✔️ | | 7,775 unique at first. Added "2a". |
| 39 | TR | Turkish | 7,776 | | | | ✔️ | | 7,775 unique at first. Added "2a". |
| 40 | UK | Ukranian | 7,000 | ✔️ | | | | | |
Here is the Chinese breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:--:|:----------------|:----------|:------:|:------------------------------|
| 7a | Chinese (Simp.) | Bitcoin | 2,048 | |
| 7b | Chinese (Trad.) | Bitcoin | 2,048 | |
| 7c | Chinese | Diceware | 8,192 | Pinyin 8k word list |
| 7d | Chinese | Monero | 1,626 | |
Here is the Czech breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:--:|:----------------|:----------|:------:|:------------------------------|
| 8a | Czech | Bitcoin | 2,048 | |
| 8b | Czech | Diceware | 7,776 | |
| 8c | Czech | Monero | 1,626 | |
Here is the English breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:---:|:----------------------|:------------|:------:|:-------------------------------------|
| 12a | Colors | Alternate | 1,029 | More available in the project |
| 12b | Deseret | Alternate | 7,776 | Alternate English alphabet |
| 12c | DIBELS | Pseudowords | 3,215 | |
| 12d | Distant | EFF | 1,296 | |
| 12e | English | Bitcoin | 2,048 | |
| 12f | English | Diceware | 8,192 | 8k word list |
| 12g | English | Monero | 1,626 | |
| 12h | English (Beale) | Diceware | 7,776 | |
| 12i | English (NLP) | Diceware | 9,072 | 1,296 adjectives, 7,776 nouns |
| 12j | Game of Thrones | EFF | 4,000 | Unofficial |
| 12k | Harry Potter | EFF | 4,000 | Unofficial |
| 12l | Long | EFF | 1,296 | |
| 12m | Lord of the Rings | Alternate | 8,192 | Eyeware list |
| 12n | Obscure | Alternate | 19,687 | Compiled from phrontistry.info |
| 12o | PGP | Alternate | 512 | |
| 12p | Pokerware | Alternate | 5,304 | Formal list |
| 12q | S/KEY | Alternate | 2,048 | RFC 2289 |
| 12r | Shavian | Alternate | 7,776 | Alternate English alphabet |
| 12s | Short | EFF | 1,296 | |
| 12t | Simpsons | Alternate | 5,000 | From Peerio |
| 12u | Star Trek | EFF | 4,000 | Unofficial |
| 12v | Star Wars | EFF | 4,000 | Unofficial |
| 12w | Trump | Alternate | 8,192 | From his Twitter account |
| 12x | Verb, Adjective, Noun | Alternate | 1,207 | 432 verbs, 373 adjectives, 402 nouns |
| 12y | Wordle | Alternate | 5,790 | See comment in word list |
| 12z | zxcvbn | Alternate | 30,000 | Primarily English |
Here is the Spanish breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:---:|:--------|:---------|:------:|:--------------------------------------------|
| 14a | Spanish | Bitcoin | 2,048 | |
| 14b | Spanish | Diceware | 7,776 | 7,773 unique at first. Added ", "", and """ |
| 14c | Spanish | Monero | 1,626 | |
Here is the French breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:---:|:-------|:---------|:------:|:------------------------------|
| 18a | French | Bitcoin | 2,048 | |
| 18b | French | Diceware | 7,776 | |
| 18c | French | Monero | 1,626 | |
Here is the Italian breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:---:|:--------|:---------|:------:|:------------------------------|
| 21a | Italian | Bitcoin | 2,048 | |
| 21b | Italian | Diceware | 7,776 | |
| 21c | Italian | Monero | 1,626 | |
Here is the Japanese breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:---:|:---------|:---------|:------:|:------------------------------|
| 24a | Japanese | Bitcoin | 2,048 | |
| 24b | Japanese | Diceware | 7,776 | |
| 24c | Japanese | Monero | 1,626 | |
Here is the Portuguese breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:---:|:-----------|:---------|:------:|:------------------------------|
| 32a | Portuguese | Bitcoin | 2,048 | |
| 32b | Portuguese | Diceware | 7,776 | |
| 32c | Portuguese | Monero | 1,626 | |
Here is the Russian breakdown:
| ID | Name | Wordlist | Unique | Notes |
|:---:|:--------|:---------|:------:|:------------------------------|
| 34a | Russian | Diceware | 7,776 | |
| 34b | Russian | Monero | 1,626 | |
================================================
FILE: assets/style.css
================================================
@font-face {
font-family: "Noto Color Emoji";
src: url("./NotoColorEmoji-Regular.woff2") format("woff2");
}
@font-face {
font-family: "Noto Sans Mono";
src: url("./NotoSansMono-Regular.woff2") format("woff2");
}
/* body tags */
a {
color: #0000EE;
}
a:visited {
color: #551a8b;
}
body {
color: black; background-color: white;
}
dl {
display: flex;
flex-flow: row wrap;
margin-bottom: 0px;
margin-top: 32px;
}
dt {
flex-basis: 35%;
margin-left: 10px;
padding: 2px 4px;
text-align: right;
}
dd {
flex-basis: 55%;
margin: 0;
padding: 2px 4px;
}
select {
appearance: none;
background-color: #dddddd;
border:1px solid black;
border-radius: 2px;
color: black;
cursor: pointer;
font-size: 12px;
height: 25px;
padding: 3px 22px 3px 6px;
width: 165px;
}
select option {
background-color: #dddddd;
color :black;
}
select:hover {
background-color: #cccccc;
}
button {
background-color: #9951c0; /* purple */
border: #9951c0; /* purple */
border-radius: 2px;
color: #FFFFFF;
cursor: pointer;
font-size: 14px;
height: 25px;
line-height: 25px;
padding: 0px;
text-decoration: none;
width: 80px;
}
button:hover {
background: #822fb0; /* purple */
text-decoration: none;
}
button:hover {
box-shadow: 1px 1px 0px #CCC;
}
/* classes */
.clear { clear: both; }
.dark_contrast {
text-shadow:
-1px -1px 0 #bbb, 0px -1px 0 #bbb,
1px -1px 0 #bbb, -1px 0px 0 #bbb,
-1px 1px 0 #bbb, 0px 1px 0 #bbb,
1px 1px 0 #bbb, 1px 0px 0 #bbb;
}
.light_contrast {
text-shadow:
-1px -1px 0 #444, 0px -1px 0 #444,
1px -1px 0 #444, -1px 0px 0 #444,
-1px 1px 0 #444, 0px 1px 0 #444,
1px 1px 0 #444, 1px 0px 0 #444;
}
.bold {
font-weight: bold;
}
.use-entropy {
bottom: 10px;
left: 10px;
font-size: 12px;
position: absolute;
visibility: hidden;
}
.stats, .cell_overlay {
bottom: 10px;
font-size: 12px;
position: absolute;
right: 10px;
}
.statistics {
background-color: rgba(0, 0, 0, 0.85);
color: white;
cursor: pointer;
display: none;
font-size: x-large;
height: 100%;
position: absolute;
top: 0;
width: 100%;
}
.stats a, .stats a:visited {
color: #0000EE;
}
.statistics a, .statistics a:visited {
color: yellow;
}
.entropy {
right: 50%;
position: absolute;
}
.checksum {
bottom: 27px;
right: 10px;
font-size: 12px;
position: absolute;
}
.cell {
border: 1px solid black;
border-radius: 2px;
display: table-cell;
float: left;
height: 210px;
margin: 5px;
position: relative;
vertical-align: middle;
width: 372px;
}
.password {
align-items: center;
display: inline-grid;
font-family: "Noto Sans Mono";
font-size: 12pt;
height: 180px;
padding: 0 10px;
text-align: center;
width: 352px;
}
.p48::selection { background-color: #ff6464; }
.p56::selection { background-color: #ffcb64; }
.p64::selection { background-color: #ffff64; }
.p72::selection { background-color: #55d955; }
.colors, .acronym {
display: block;
margin-top: 57px;
}
.acronym p{
align-items: center;
display: inline-block;
margin: 0;
}
.acronym p::first-letter {
color: red;
font-weight: bold;
}
.cell-title {
background-color: #5777c0; /* blue */
border-bottom: 1px solid black;
color: white;
display: inline-block;
margin-top: 0px;
padding: 5px 0;
text-align: center;
width: 100%;
}
.optional {
left: 10px;
position: absolute;
top: 40px;
}
.optional::after {
bottom: 3px;
color: black;
content: '▶';
font-size: 13px;
left: 145px;
pointer-events: none;
position: absolute;
transform: rotate(90deg);
}
.feather {
vertical-align: text-bottom;
}
.pass-button {
display: inline-block;
position: absolute;
right: 10px;
top: 40px;
}
.whitespace {
display: inline-flex;
justify-content: center;
quotes: auto;
tab-size: 1;
/* Do not use "pre-wrap", as it removes end-of-line space.
"break-spaces" does not collapse tabs and spaces.
https://developer.mozilla.org/en-US/docs/Web/CSS/white-space */
white-space: break-spaces;
}
.whitespace::before {
content: open-quote;
}
.whitespace::after {
content: close-quote;
}
/* ids */
#container {
margin: 0 auto;
pointer-events: auto;
width: 768px;
}
#header {
display: inline-block;
text-align: center;
width: 100%;
}
#footer {
text-align: center;
}
#version {
font-size: 10pt;
}
#overlay {
position: fixed;
display: none;
width: 100%;
height: 100%;
top: 0; left: 0; right: 0; bottom: 0;
background-color: rgba(0, 0, 0, 0.85);
z-index: 1;
cursor: pointer;
}
#overlay_text {
position: absolute;
top: 50%;
left: 50%;
font-size: 18pt;
color: white;
text-align: center;
transform: translate(-50%, -50%);
}
#content {
display: table;
margin-top: 10px;
}
#navigation {
padding-left: 0;
}
#navigation li {
display: inline;
list-style-type: none;
margin: 0 auto;
padding: 0 10px 0 10px;
}
#alt-pass, #crypto-pass, #diceware-pass, #eff-pass, #pseudo-pass {
word-break: break-word;
}
#random-pass {
word-break: break-all;
}
#password-strength {
margin: 0px auto;
}
#input {
display: block;
margin: 10px auto;
}
input[type=range] {
-webkit-appearance: none;
appearance: none;
background: none;
width: 200px;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
background: var(--track-background, none);
border: 1px solid black;
border-radius: 2px;
height: 16px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
background: #7f7f7f;
border: 1px solid black;
border-radius: 2px;
height: 24px;
margin-top: -5px;
width: 24px;
}
input[type=range]::-moz-range-track {
background: var(--track-background, none);
border: 1px solid black;
border-radius: 2px;
height: 16px;
}
input[type=range]::-moz-range-thumb {
background: #7f7f7f;
border: 1px solid black;
border-radius: 2px;
height: 24px;
width: 24px;
}
/* Mouse Entropy CSS */
#randogram {
cursor: url('data:image/gif;base64,R0lGODlhFAAUAPABAKoAAP///yH5BAUKAAEALAAAAAAUABQAQAIsRI6pCe2+1Is0PFPl3Vj3zGzgwU2UOFpfqrJh46rmWNLl6t3nPSOXC4nhUgUAOw=='), crosshair;
margin: 0 calc((100% - 400px)/2);
touch-action: none;
}
.collected {
font-family: monospace;
font-weight: bold;
height: 40px;
line-height: 40px;
text-align: center;
}
@media only screen and (max-width: 767px) {
#container { width: 480px; }
.cell { margin: 5px 10px; width: 460px; }
.password { width: 440px; }
}
@media only screen and (max-width: 479px) {
#container { width: 100%; }
.cell { width: 95%; }
.password { width: 95%; }
}
/* override styles for Dark Theme */
body.dark-theme {color: white; background-color: black;}
.dark-theme .cell { border-color: #FFF; }
.dark-theme a {color: yellow;}
.dark-theme a:visited {color: orange;}
.dark-theme img {filter: invert(1);}
.dark-theme input[type=range]::-webkit-slider-runnable-track {border: 1px solid white;}
.dark-theme input[type=range]::-webkit-slider-thumb {border: 1px solid white;}
.dark-theme input[type=range]::-moz-range-track {border: 1px solid white;}
.dark-theme input[type=range]::-moz-range-thumb {border: 1px solid white;}
.dark-theme .statistics {background-color: rgb(255, 255, 255, 0.85); color: black;}
.dark-theme .stats a {color: yellow;}
.dark-theme .stats a:visited {color: yellow;}
.dark-theme .statistics a {color: #0000EE;}
.dark-theme .statistics a:visited {color: #0000EE;}
#theme_switcher {
text-decoration: none;
}
================================================
FILE: bookmarklets.html
================================================
<!doctype html>
<html lang='en'>
<head>
<link rel='shortcut icon' href='favicon.ico'>
<link rel='stylesheet' href='assets/style.css'>
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<meta name='color-scheme' content='dark light'>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>Passphrase and Password Generator</title>
<style>
table {
width: 100%;
}
td {
padding: 5px;
width: 25%;
}
</style>
</head>
<body>
<div id='container'>
<div id='header'>
<h1>Browser Bookmarklets</h1>
<ul id='navigation'>
<li><a href='index.html'>Passwords</a></li>
<li><a href='entropy.html'>Entropy</a></li>
<li><a href='bookmarklets.html'>Bookmarklets</a></li>
<li>
<a href='javascript:void(0)' onclick='toggleTheme();' id='theme_switcher' title='Change theme'>
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='currentColor' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-moon'>
<path d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'></path>
</svg>
</a>
</li>
</ul>
</div>
<div id='content'>
<p>These bookmarklets are <strong>offline</strong> password generators. First inspect the source code to ensure it's doing what you expect and that it's fully offline.</p>
<p>Passphrases, such as Diceware or EFF, and the Letterblock Pseudowords aren't provided due to their size as well as the requirement to generate completely offline. The Unicode generators are also not provided.</p>
<p>The JavaScript "window.alert()" function is used to give you the password. You may need to tweak your pop-up blocking preferences to see the generated password.</p>
<p>Drag and drop any or all links to your bookmark toolbar.</p>
<h4>Pseudoword Bookmarklets</h4>
<table>
<tr>
<!-- To save space in readability, use tabs in each bookmarklet, not spaces -->
<td> <!-- Apple, Inc. Pseudowords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass;
}
function generateApple () {
function _apple(n) {
return Math.floor(Math.log2((6*n-1) * 19**(4*n-1) * 6**(2*n) * 20 * n));
}
let pass = [];
let digits = "0123456789";
let vowels = "aeiouy";
let consonants = "bcdfghjkmnpqrstvwxz";
const entropy = 70;
let n = 1;
while (_apple(n) <= entropy) n++;
for (let i = 0; i < n; i++) {
pass[6*i] = generatePass(1, consonants);
pass[6*i+1] = generatePass(1, vowels);
pass[6*i+2] = generatePass(1, consonants);
pass[6*i+3] = generatePass(1, consonants);
pass[6*i+4] = generatePass(1, vowels);
pass[6*i+5] = generatePass(1, consonants);
}
let digitLoc = 0;
let charLoc = 0;
let edge = secRand(2*n);
let digit = generatePass(1, digits);
if (edge % 2 == 0) digitLoc = 3*edge;
else digitLoc = 3*edge+2;
pass[digitLoc] = digit;
do charLoc = secRand(pass.length);
while (charLoc == digitLoc);
pass[charLoc] = pass[charLoc].toUpperCase();
for (let i = n - 1; i > 0; i--) pass.splice(6 * i, 0, "-");
return pass.join("");
}
window.alert(generateApple());
})();'>Apple Inc.</a>
</td>
<td> <!-- Bubble Babble Pseudowords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateBabble () {
const vowels = "aeiouy";
const consonants = "bcdfghklmnprstvzx";
const bytes = Math.ceil(70 / 8);
const entropy = new Uint8Array(bytes);
let pass = "x";
let checksum = 1;
for (let i = 0; i < entropy.length; i++) entropy[i] = secRand(256);
for (let i = 0; i <= entropy.length; i += 2) {
if (i >= entropy.length) {
pass += vowels[checksum % 6] + consonants[16] + vowels[Math.floor(checksum / 6)];
break;
}
byte1 = entropy[i];
pass += vowels[(((byte1 >> 6) & 3) + checksum) % 6];
pass += consonants[(byte1 >> 2) & 15];
pass += vowels[((byte1 & 3) + Math.floor(checksum / 6)) % 6];
if ((i + 1) >= entropy.length) break;
byte2 = entropy[i+1];
pass += consonants[(byte2 >> 4) & 15];
pass += "-";
pass += consonants[byte2 & 15];
checksum = ((checksum * 5) + (byte1 * 7) + byte2) % 36;
}
pass += "x";
return pass;
}
window.alert(generateBabble());
})();'>Bubble Babble (Checksum)</a>
</td>
<td> <!-- Munemo Pseudowords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generateMunemo () {
function _tos(num, str) {
const munemo = [
"ba", "bi", "bu", "be", "bo", "cha", "chi", "chu", "che", "cho",
"da", "di", "du", "de", "do", "fa", "fi", "fu", "fe", "fo",
"ga", "gi", "gu", "ge", "go", "ha", "hi", "hu", "he", "ho",
"ja", "ji", "ju", "je", "jo", "ka", "ki", "ku", "ke", "ko",
"la", "li", "lu", "le", "lo", "ma", "mi", "mu", "me", "mo",
"na", "ni", "nu", "ne", "no", "pa", "pi", "pu", "pe", "po",
"ra", "ri", "ru", "re", "ro", "sa", "si", "su", "se", "so",
"sha", "shi", "shu", "she", "sho", "ta", "ti", "tu", "te", "to",
"tsa", "tsi", "tsu", "tse", "tso", "wa", "wi", "wu", "we", "wo",
"ya", "yi", "yu", "ye", "yo", "za", "zi", "zu", "ze", "zo"
];
mod = num % 100n;
rem = num / 100n;
str = munemo[mod] + str;
if (rem > 0) return _tos(rem, str);
else return str;
}
const minEntropy = 70;
const isNegative = secRand(2);
let num = 0n;
for (let i = 0; i < minEntropy - 1; i++) num += BigInt(secRand(2) * (2 ** i));
let pass = _tos(num, "");
if (isNegative) pass = "xa" + pass;
return pass;
}
window.alert(generateMunemo());
})();'>Munemo</a>
</td>
<td> <!-- Proquints Pseudowords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generateProquints () {
const vowels = "aiou";
const consonants = "bdfghjklmnprstvz";
const entropy = 70;
const len = Math.ceil(entropy / 16);
let pass = consonants[secRand(16)];
for (let i = len; i > 0; i--) {
pass += vowels[secRand(4)];
pass += consonants[secRand(16)];
pass += vowels[secRand(4)];
if (i === 1) break;
pass += consonants[secRand(16)];
pass += "-";
pass += consonants[secRand(16)];
}
pass += consonants[secRand(16)];
return pass;
}
window.alert(generateProquints());
})();'>Proquints</a>
</td>
</tr>
</table>
<h4>Random Password Bookmarklets</h4>
<table>
<tr>
<td> <!-- Base-94 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
let s = "";
const entropy = 70;
for (i=0; i<94; i++) s += String.fromCharCode(33+i);
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-94</a>
</td>
<td> <!-- Base-85 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&()*+-;<=>?@^_`{|}~";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-85</a>
</td>
<td> <!-- Base-64 (+/) Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-64 (+/)</a>
</td>
<td> <!-- Base-64 (-_) Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-64 (-_)</a>
<br/>
</td>
</tr>
<tr>
<td> <!-- Base-62 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-62</a>
</td>
<td> <!-- Base-58 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom())
})();'>Base-58</a>
</td>
<td> <!-- Base-52 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-52</a>
</td>
<td> <!-- Base-45 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_$%*+-./:";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-45</a>
</td>
</tr>
<tr>
<td> <!-- Base-36 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "0123456789abcdefghijklmnopqrstuvwxyz";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-36</a>
</td>
<td> <!-- Base-32 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "0123456789abcdefghjkmnpqrstvwxyz";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
let check = 0n;
s += "*~$=u";
displayCheck = true;
for (let i = 0; i < pass.length; i++) check += BigInt(s.indexOf(pass[i]) * 32**(pass.length - i - 1));
pass += s[check % 37n];
return pass;
}
window.alert(generateRandom());
})();'>Base-32 (Checksum)</a>
</td>
<td> <!-- Base-26 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "abcdefghijklmnopqrstuvwxyz";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-26</a>
</td>
<td> <!-- Base-16 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "0123456789abcdef";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-16</a>
</td>
</tr>
<tr>
<td> <!-- Base-10 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "0123456789";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-10</a>
</td>
<td> <!-- Base-8 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "01234567";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-8</a>
</td>
<td> <!-- Base-4 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "ACGT";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-4</a>
</td>
<td> <!-- Base-2 Random Passwords -->
<a class='bookmarklet' href='javascript:(function() {
function secRand (count) {
const min = (-count >>> 0) % count;
const rand = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
do crypto.getRandomValues(rand);
while (rand[0] < min);
return rand[0] % count;
}
function generatePass (len, set) {
let pass = "";
let passArr = "";
if (typeof set == "string") passArr = set.split("");
else passArr = set;
for (let i = len; i > 0; i--) pass += passArr[secRand(set.length)];
return pass.trim();
}
function generateRandom () {
const entropy = 70;
let s = "01";
let len = Math.ceil(entropy / Math.log2(s.length));
let pass = generatePass(len, s);
return pass;
}
window.alert(generateRandom());
})();'>Base-2</a>
</td>
</tr>
</table>
</div>
<div id='footer' class='clear'>
<p>Never trust online password generators, including this one.<br/>
For better security, use the <a href='bookmarklets.html'>bookmarklets</a>, or my <a href='https://github.com/atoponce/nodepassgen'>command-line tool</a>.<br/>
For best security, use the generator that ships with your password manager.</p>
<p><strong>For demonstration purposes only. It is not logging passwords.</strong></p>
<p>
<a href='https://github.com/atoponce/webpassgen'><img alt='Github logo' title='Get the source code' src='assets/github.png' /></a>
<a href='https://github.com/atoponce/webpassgen/releases/latest'><img alt='Download icon' title='Download latest release' src='assets/download.png' /></a>
<a href='https://twitter.com/AaronToponce'><img alt='Twitter logo' title='Meet the author' src='assets/twitter.png' /></a>
</p>
<p id='version'>Version: development</p>
</div>
<script src='js/main.js'></script>
<script>
window.onload = function () {
initTheme();
};
</script>
</body>
</html>
================================================
FILE: entropy.html
================================================
<!DOCTYPE html>
<html lang='en'>
<head>
<link rel='shortcut icon' href='favicon.ico'>
<link rel='stylesheet' href='assets/style.css'>
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<meta name='color-scheme' content='dark light'>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>Passphrase and Password Generator</title>
</head>
<body>
<div id='container'>
<div id='header'>
<h1>Mouse Entropy</h1>
<ul id='navigation'>
<li><a href='index.html'>Passwords</a></li>
<li><a href='entropy.html'>Entropy</a></li>
<li><a href='bookmarklets.html'>Bookmarklets</a></li>
<li>
<a href='javascript:void(0)' onclick='toggleTheme();' id='theme_switcher' title='Change theme'>
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='currentColor' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-moon'>
<path d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'></path>
</svg>
</a>
</li>
</ul>
</div>
<div id='content'>
<p>Capture arbitrary bits to build a <strong>true random</strong> password by moving your mouse/finger across the noise below. This utilizes your mouse/finger movements as a source of entropy. Inspired by <a href='https://keepass.info'>KeePass</a>.</p>
<p class='collected'>Collected:
<span class='collected' id='entropyResult2'>0</span> samples
(<span class='collected' id='entropyResult1'>0</span> bits)
</p>
<canvas id='randogram' height='400' width='400'></canvas>
<p class='collected'>Current rank:
<span class='collected' id='officerRank'>Cadet</span>
<span class='collected' id='rankPips'></span><br/>
Next rank: <span class='collected' id='nextRank'></span> in
<span class='collected' id='remainingRankBits'></span> bits
</p>
<h2>FAQ</h2>
<p>
<ul>
<li><strong>What is the goal?</strong> To add entropy to the browser CSPRNG to produce a true random password.</li>
<li><strong>Do I need it?</strong> Most likely not. Your passwords are already secure even if you don't use this tool.</li>
<li><strong>Why then?</strong> Paranoia—you suspect the browser CSPRNG is compromised or not sufficiently seeded.</li>
<li><strong>What is a "sample"?</strong> It's 16 bits that can be used for a passphrase word or password character.</li>
<li><strong>How much do I need?</strong> You'll need about 5-7 samples per passphrase, and 11-15 samples per password.</li>
<li><strong>Then what?</strong> Go back to the <a href='index.html'>password generator</a>, check "Add entropy?", then the purple "Generate" button.</li>
<li><strong>Star Trek? Seriously?</strong> A bit of fun collecting entropy. The more bits you collect, the higher your rank.</li>
<li><strong>What are the ranks?</strong> There are 13 ranks from "Cadet" to "Fleet Admiral". It grows exponentially.</li>
</ul>
</p>
<h2>Technical</h2>
<p>
<ol>
<li>The noise above is generated with the browser's CSPRNG.</li>
<li>When your mouse or finger is moved, the bit at the xy-coordinate is collected.</li>
<li>When two bits are collected, they are decorrelated using <a href='https://en.wikipedia.org/wiki/Hardware_random_number_generator#Software_whitening'>John von Neumann's randomness extractor</a>.</li>
<li>16 decorrelated bits are stored in an array as 1 sample.</li>
<li>During password generation, each 16-bit sample is mixed with the browser CSPRNG using XOR.</li>
<li>Each used 16-bit sample is then discarded.</li>
</ol>
</p>
</div>
<div id="footer" class="clear">
<p>Never trust online password generators, including this one.<br/>
For better security, use the <a href="bookmarklets.html">bookmarklets</a>, or my <a href="https://github.com/atoponce/nodepassgen">command-line tool</a>.<br/>
For best security, use the generator that ships with your password manager.</p>
<p><strong>For demonstration purposes only. It is not logging passwords.</strong></p>
<p>
<a href="https://github.com/atoponce/webpassgen"><img alt="Github logo" title="Get the source code" src="assets/github.png" /></a>
<a href="https://github.com/atoponce/webpassgen/releases/latest"><img alt="Download icon" title="Download latest release" src="assets/download.png" /></a>
<a href="https://twitter.com/AaronToponce"><img alt="Twitter logo" title="Meet the author" src="assets/twitter.png" /></a>
</p>
<p id='version'>Version: development</p>
</div>
</div>
<script src='js/main.js'></script>
<script src='js/randogram.js'></script>
<script>
"use strict"
window.onload = function () {
initTheme()
}
</script>
</body>
</html>
================================================
FILE: index.html
================================================
<!doctype html>
<html lang='en'>
<head>
<link rel='manifest' href='manifest.json'>
<link rel='shortcut icon' href='assets/favicon.svg'>
<link rel='stylesheet' href='assets/style.css'>
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<meta name='color-scheme' content='dark light'>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>Passphrase and Password Generator</title>
</head>
<body>
<div id='container'>
<div id='header'>
<h1>Passphrase & Password Generator</h1>
<h4>Exploring what password generation could look like. This generator doesn't suck.</h4>
<p style="font-size: small;"></p>
<ul id='navigation'>
<li><a href='index.html'>Passwords</a></li>
<li><a href='entropy.html'>Entropy</a></li>
<li><a href='bookmarklets.html'>Bookmarklets</a></li>
<li>
<a href='javascript:void(0)' onclick='toggleTheme(); loadPasses();' id='theme_switcher' title='Change theme'>
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='currentColor' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-moon'>
<path d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'></path>
</svg>
</a>
</li>
</ul>
<div id='password-strength'>
<input id='input' type='range' min='48' max='128' step='8' value='72' oninput='updateSlider(parseInt(value)); loadPasses();'>
<span>Password strength: </span>
<output id='output' for=value>72</output>
<span> bits</span>
</div>
</div>
<div id='content'>
<div id='alt-default' class='cell'>
<span class='cell-title'><strong>Alternate</strong></span>
<div class='optional'>
<select id='alt-options'>
<optgroup label='English'>
<option>Acronyms</option>
<option selected='selected'>Common Words Only</option>
<option>Every Word List</option>
<option disabled>――――――――――</option>
<option>Colors</option>
<option>Deseret Alphabet</option>
<option>Lord of the Rings</option>
<option>Obscure</option>
<option>PGP</option>
<option>Pokerware</option>
<option>Shavian Alphabet</option>
<option>Simpsons</option>
<option>S/KEY</option>
<option>Trump</option>
<option>Verb, Adjective, Noun</option>
<option>Wordle</option>
<option>zxcvbn</option>
</optgroup>
<optgroup label='Non-English'>
<option>Afrikaans</option>
<option>Belarusian</option>
<option>Croatian</option>
<option>Elvish</option>
<option>Klingon</option>
<option>Mongolian</option>
<option>Serbian</option>
<option>Ukranian</option>
</optgroup>
</select>
</div>
<button class='pass-button' value='Generate' onclick='generatePassphrase("alternate");'>Generate</button>
<div id='alt-pass' class='password'></div>
<div class='use-entropy'>
<input type='checkbox' id='alt-entropy-check' name='entropy-check' value='alt-ntropy'>
<label for='alt-entropy-check'> Add entropy?</label>
<span></span> samples left.
</div>
<div class='stats'>
<span><a href='javascript:void(0)' onclick='toggleStats("alternate")'>Passphrase Statistics</a></span>
</div>
<div class='checksum'><span id='alt-check'></span></div>
<div id='alt-overlay' class='statistics'>
<dl>
<dt>Length:</dt><dd id='alt-length'></dd>
<dt>Security:</dt><dd id='alt-entropy'></dd>
<dt>Set size:</dt><dd id='alt-set-size'></dd>
</dl>
<span class="cell_overlay">
<a href='javascript:void(0)' onclick='toggleStats("alternate")'>Click here to dismiss</a>
</span>
</div>
</div>
<div id='crypto-default' class='cell'>
<span class='cell-title'><strong>Cryptocurrency</strong></span>
<div class='optional'>
<select id='cryptocurrency-options'>
<optgroup label='Bitcoin'>
<option>Chinese (Simp)</option>
<option>Chinese (Trad)</option>
<option>Czech</option>
<option selected='selected'>English</option>
<option>French</option>
<option>Italian</option>
<option>Japanese</option>
<option>Korean</option>
<option>Portuguese</option>
<option>Spanish</option>
</optgroup>
<optgroup label='Monero'>
<option>Chinese</option>
<option>Dutch</option>
<option>English</option>
<option>Esperanto</option>
<option>French</option>
<option>German</option>
<option>Italian</option>
<option>Japanese</option>
<option>Lojban</option>
<option>Portuguese</option>
<option>Russian</option>
<option>Spanish</option>
</optgroup>
</select>
</div>
<button class='pass-button' value='Generate' onclick='generatePassphrase("cryptocurrency");'>Generate</button>
<div id='crypto-pass' class='password'></div>
<div class='use-entropy'>
<input type='checkbox' id='crypto-entropy-check' name='entropy-check' value='crypto-entropy'>
<label for='crypto-entropy-check'> Add entropy?</label>
<span></span> samples left.
</div>
<div class='stats'>
<span><a href='javascript:void(0)' onclick='toggleStats("cryptocurrency")'>Passphrase Statistics</a></span>
</div>
<div class='checksum'><span id='crypto-check'></span></div>
<div id='crypto-overlay' class='statistics'>
<dl>
<dt>Length:</dt><dd id='crypto-length'></dd>
<dt>Security:</dt><dd id='crypto-entropy'></dd>
<dt>Set size:</dt><dd id='crypto-set-size'></dd>
</dl>
<span class="cell_overlay">
<a href='javascript:void(0)' onclick='toggleStats("cryptocurrency")'>Click here to dismiss</a>
</span>
</div>
<div class='checksum'><span id='crypto-check'></span></div>
</div>
<div id='diceware-default' class='cell'>
<span class='cell-title'><strong>Diceware</strong></span>
<div class='optional'>
<select id='diceware-options'>
<option>Basque</option>
<option>Bulgarian</option>
<option>Catalan</option>
<option>Chinese</option>
<option>Czech</option>
<option>Danish</option>
<option>Dutch</option>
<option selected='selected'>English</option>
<option>English (Beale)</option>
<option>English (NLP)</option>
<option>Esperanto</option>
<option>Estonian</option>
<option>Finnish</option>
<option>French</option>
<option>German</option>
<option>Greek</option>
<option>Hebrew</option>
<option>Hungarian</option>
<option>Italian</option>
<option>Japanese</option>
<option>Latin</option>
<option>Maori</option>
<option>Norwegian</option>
<option>Polish</option>
<option>Portuguese</option>
<option>Romanian</option>
<option>Russian</option>
<option>Slovak</option>
<option>Slovenian</option>
<option>Spanish</option>
<option>Swedish</option>
<option>Turkish</option>
</select>
</div>
<button class='pass-button' value='Generate' onclick='generatePassphrase("diceware");'>Generate</button>
<div id='diceware-pass' class='password'></div>
<div class='use-entropy'>
<input type='checkbox' id='diceware-entropy-check' name='entropy-check' value='diceware-entropy'>
<label for='diceware-entropy-check'> Add entropy?</label>
<span></span> samples left.
</div>
<div class='stats'>
<span><a href='javascript:void(0)' onclick='toggleStats("diceware")'>Passphrase Statistics</a></span>
</div>
<div class='checksum'><span id='diceware-check'></span></div>
<div id='diceware-overlay' class='statistics'>
<dl>
<dt>Length:</dt><dd id='diceware-length'></dd>
<dt>Security:</dt><dd id='diceware-entropy'></dd>
<dt>Set size:</dt><dd id='diceware-set-size'></dd>
</dl>
<span class="cell_overlay">
<a href='javascript:void(0)' onclick='toggleStats("diceware")'>Click here to dismiss</a>
</span>
</div>
<div class='checksum'><span id='diceware-check'></span></div>
</div>
<div id='eff-default' class='cell'>
<span class='cell-title'><strong>EFF</strong></span>
<div class='optional'>
<select id='eff-options'>
<optgroup label='Official'>
<option>Distant Words</option>
<option>Long Words</option>
<option selected='selected'>Short Words</option>
</optgroup>
<optgroup label='Unofficial'>
<option>Game of Thrones</option>
<option>Harry Potter</option>
<option>Star Trek</option>
<option>Star Wars</option>
</select>
</div>
<button class='pass-button' value='Generate' onclick='generatePassphrase("eff");'>Generate</button>
<div id='eff-pass' class='password'></div>
<div class='use-entropy'>
<input type='checkbox' id='eff-entropy-check' name='entropy-check' value='eff-entropy'>
<label for='eff-entropy-check'> Add entropy?</label>
<span></span> samples left.
</div>
<div class='stats'>
<span><a href='javascript:void(0)' onclick='toggleStats("eff")'>Passphrase Statistics</a></span>
</div>
<div class='checksum'><span id='eff-check'></span></div>
<div id='eff-overlay' class='statistics'>
<dl>
<dt>Length:</dt><dd id='eff-length'></dd>
<dt>Security:</dt><dd id='eff-entropy'></dd>
<dt>Set size:</dt><dd id='eff-set-size'></dd>
</dl>
<span class="cell_overlay">
<a href='javascript:void(0)' onclick='toggleStats("eff")'>Click here to dismiss</a>
</span>
</div>
<div class='checksum'><span id='eff-check'></span></div>
</div>
<div id='pseudo-default' class='cell'>
<span class='cell-title'><strong>Pseudowords</strong></span>
<div class='optional'>
<select id='pseudo-options'>
<option>Apple Keychain</option>
<option>Bubble Babble</option>
<option>Daefen</option>
<option>DIBELS</option>
<option>Koremutake</option>
<option>Lepron</option>
<option>Letterblock Diceware</option>
<option>Munemo</option>
<option>Proquints</option>
<option>Urbit</option>
</select>
</div>
<button class='pass-button' value='Generate' onclick='generatePseudowords();'>Generate</button>
<div id='pseudo-pass' class='password'></div>
<div class='use-entropy'>
<input type='checkbox' id='pseudo-entropy-check' name='entropy-check' value='pseudo-entropy'>
<label for='pseudo-entropy-check'> Add entropy?</label>
<span></span> samples left.
</div>
<div class='stats'>
<span><a href='javascript:void(0)' onclick='toggleStats("pseudo")'>Pseudoword Statistics</a></span>
</div>
<div class='checksum'><span id='pseudo-check'></span></div>
<div id='pseudo-overlay' class='statistics'>
<dl>
<dt>Length:</dt><dd id='pseudo-length'></dd>
<dt>Security:</dt><dd id='pseudo-entropy'></dd>
<dt>Set size:</dt><dd id='pseudo-set-size'></dd>
</dl>
<span class="cell_overlay">
<a href='javascript:void(0)' onclick='toggleStats("pseudo")'>Click here to dismiss</a>
</span>
</div>
<div class='checksum'><span id='pseudo-check'></span></div>
</div>
<div id='random-default' class='cell'>
<span class='cell-title'><strong>Random</strong></span>
<div class='optional'>
<select id='random-options'>
<optgroup label='ASCII'>
<option selected>Base94</option>
<option>Base85</option>
<option>Base64</option>
<option>Base62</option>
<option>Base58</option>
<option>Base52</option>
<option>Base45</option>
<option>Base36</option>
<option>Base32</option>
<option>Base26</option>
<option>Base16</option>
<option>Base10</option>
<option>Base8</option>
<option>Base4</option>
<option>Base2</option>
</optgroup>
<optgroup label='Unicode'>
<option>Emoji</option>
<option>ISO 8859-1</option>
<option>Latin Extended</option>
<option>Mac OS Roman</option>
<option>Whitespace</option>
</optgroup>
</select>
</div>
<button class='pass-button' value='Generate' onclick='generateRandom();'>Generate</button>
<div id='random-pass' class='password'></div>
<div class='use-entropy'>
<input type='checkbox' id='random-entropy-check' name='entropy-check' value='random-entropy'>
<label for='random-entropy-check'> Add entropy?</label>
<span></span> samples left.
</div>
<div class='stats'>
<span><a href='javascript:void(0)' onclick='toggleStats("random")'>Password Statistics</a></span>
</div>
<div class='checksum'><span id='random-check'></span></div>
<div id='random-overlay' class='statistics'>
<dl>
<dt>Length:</dt><dd id='random-length'></dd>
<dt>Security:</dt><dd id='random-entropy'></dd>
<dt>Set size:</dt><dd id='random-set-size'></dd>
</dl>
<span class="cell_overlay">
<a href='javascript:void(0)' onclick='toggleStats("random")'>Click here to dismiss</a>
</span>
</div>
<div class='checksum'><span id='random-check'></span></div>
</div>
</div>
<div id='footer' class='clear'>
<p>Never trust online password generators, including this one.<br/>
For better security, use the <a href='bookmarklets.html'>bookmarklets</a>, or my <a href='https://github.com/atoponce/nodepassgen'>command-line tool</a>.<br/>
For best security, use the generator that ships with your password manager.</p>
<p><strong>For demonstration purposes only. It is not logging passwords.</strong></p>
<p>
<a href='https://github.com/atoponce/webpassgen'><img alt='Github logo' title='Get the source code' src='assets/github.png' /></a>
<a href='https://github.com/atoponce/webpassgen/releases/latest'><img alt='Download icon' title='Download latest release' src='assets/download.png' /></a>
<a href='https://twitter.com/AaronToponce'><img alt='Twitter logo' title='Meet the author' src='assets/twitter.png' /></a>
</p>
<p id='version'>Version: 20231024</p>
</div>
</div>
<div id='overlay' onclick='document.getElementById("overlay").style.display="none";'>
<div id='overlay_text'>
<p>🔥🔥🔥🔥🔥</p>
<p>Here be dragons!</p>
<p>Using non-ASCII Unicode characters could <a style='color: #F3BC00' href='https://apple.stackexchange.com/questions/202143/i-included-emoji-in-my-password-and-now-i-cant-log-in-to-my-account-on-yosemite'>lock you out of your account</a>!</p>
<p>Further, emoji code points specifically are <a style='color: #F3BC00' href='https://twitter.com/FakeUnicode/status/1192245294429130752'>ambiguous, ignored, unpredictable, and unstable</a>.</p>
<p>You should exercise extreme caution using Unicode passwords.</p>
<p>Click anywhere to continue.</p>
<p>🐉🐉🐉🐉🐉</p>
</div>
</div>
<!-- main page scripts -->
<script src='js/main.js'></script>
<!-- the box generator scripts -->
<script src='js/alternate.js'></script>
<script src='js/cryptocurrency.js'></script>
<script src='js/diceware.js'></script>
<script src='js/eff.js'></script>
<script src='js/pseudowords.js'></script>
<script src='js/random.js'></script>
<!-- alternate passphrase generator -->
<script src='lists/alternateAF.js'></script>
<script src='lists/alternateBE.js'></script>
<script src='lists/alternateColors.js'></script>
<script src='lists/alternateHR.js'></script>
<script src='lists/alternateDeseret.js'></script>
<script src='lists/alternateElvish.js'></script>
<script src='lists/alternateEyeware.js'></script>
<script src='lists/alternateKlingon.js'></script>
<script src='lists/alternateMN.js'></script>
<script src='lists/alternateObscure.js'></script>
<script src='lists/alternatePgp.js'></script>
<script src='lists/alternatePokerware.js'></script>
<script src='lists/alternateShavian.js'></script>
<script src='lists/alternateSimpsons.js'></script>
<script src='lists/alternateSkey.js'></script>
<script src='lists/alternateSR.js'></script>
<script src='lists/alternateTrump.js'></script>
<script src='lists/alternateUK.js'></script>
<script src='lists/alternateVAN.js'></script>
<script src='lists/alternateWordle.js'></script>
<script src='lists/alternateZxcvbn.js'></script>
<!-- cryptocurrency passphrase generator -->
<script src='lists/bitcoinCNSimp.js'></script>
<script src='lists/bitcoinCNTrad.js'></script>
<script src='lists/bitcoinCZ.js'></script>
<script src='lists/bitcoinEN.js'></script>
<script src='lists/bitcoinES.js'></script>
<script src='lists/bitcoinFR.js'></script>
<script src='lists/bitcoinIT.js'></script>
<script src='lists/bitcoinJP.js'></script>
<script src='lists/bitcoinKR.js'></script>
<script src='lists/bitcoinPT.js'></script>
<script src='lists/moneroCN.js'></script>
<script src='lists/moneroDE.js'></script>
<script src='lists/moneroEN.js'></script>
<script src='lists/moneroEO.js'></script>
<script src='lists/moneroES.js'></script>
<script src='lists/moneroFR.js'></script>
<script src='lists/moneroIT.js'></script>
<script src='lists/moneroJBO.js'></script>
<script src='lists/moneroJP.js'></script>
<script src='lists/moneroNL.js'></script>
<script src='lists/moneroPT.js'></script>
<script src='lists/moneroRU.js'></script>
<!-- diceware passphrase generator -->
<script src='lists/dicewareBG.js'></script>
<script src='lists/dicewareCA.js'></script>
<script src='lists/dicewareCN.js'></script>
<script src='lists/dicewareCZ.js'></script>
<script src='lists/dicewareDA.js'></script>
<script src='lists/dicewareDE.js'></script>
<script src='lists/dicewareEL.js'></script>
<script src='lists/dicewareEN.js'></script> <!-- English -->
<script src='lists/dicewareBeale.js'></script> <!-- English -->
<script src='lists/dicewareNLP.js'></script> <!-- English -->
<script src='lists/dicewareEO.js'></script>
<script src='lists/dicewareES.js'></script>
<script src='lists/dicewareET.js'></script>
<script src='lists/dicewareEU.js'></script>
<script src='lists/dicewareFI.js'></script>
<script src='lists/dicewareFR.js'></script>
<script src='lists/dicewareHU.js'></script>
<script src='lists/dicewareIT.js'></script>
<script src='lists/dicewareIW.js'></script>
<script src='lists/dicewareJP.js'></script>
<script src='lists/dicewareLA.js'></script>
<script src='lists/dicewareMI.js'></script>
<script src='lists/dicewareNL.js'></script>
<script src='lists/dicewareNO.js'></script>
<script src='lists/dicewarePL.js'></script>
<script src='lists/dicewarePT.js'></script>
<script src='lists/dicewareRO.js'></script>
<script src='lists/dicewareRU.js'></script>
<script src='lists/dicewareSK.js'></script>
<script src='lists/dicewareSL.js'></script>
<script src='lists/dicewareSV.js'></script>
<script src='lists/dicewareTR.js'></script>
<!-- eff passphrase generator -->
<script src='lists/effDistant.js'></script>
<script src='lists/effGameOfThrones.js'></script>
<script src='lists/effHarryPotter.js'></script>
<script src='lists/effLong.js'></script>
<script src='lists/effShort.js'></script>
<script src='lists/effStarTrek.js'></script>
<script src='lists/effStarWars.js'></script>
<!-- pseudowords generator-->
<script src='lists/pseudoBigrams.js'></script>
<script src='lists/pseudoDibels.js'></script>
<!-- emoji - on its own -->
<script src='lists/randomEmoji.js'></script>
<script>
"use strict"
document.body.lang = navigator.language
window.onload = function() {
mork()
initTheme()
setSecurity()
loadPasses()
}
</script>
</body>
================================================
FILE: js/alternate.js
================================================
"use strict"
const altProps = {
"passId": document.getElementById('alt-pass'),
"passLength": document.getElementById('alt-length'),
"passEntropy": document.getElementById('alt-entropy'),
"setSize": document.getElementById('alt-set-size'),
"entropyCheck": document.getElementById('alt-entropy-check'),
}
/**
* Generate an Alternate passphrase based on the chosen word list.
* @param {string} selection - An Alternate word list.
*/
function generateAlternate(selection) {
let pass = ''
let wordList = ''
if (selection === 'Afrikaans') {
wordList = alternateAF
} else if (selection === 'Belarusian') {
wordList = alternateBE
} else if (selection === 'Colors') {
return generateColors()
} else if (selection === 'Croatian') {
wordList = alternateHR
} else if (selection === 'Elvish') {
wordList = alternateElvish
} else if (selection === 'Acronyms' || selection === 'Every Word List') {
wordList = Object.keys(alternateColors) // 1029 words
wordList = wordList.concat(alternateEyeware) // 8192 words
wordList = wordList.concat(alternateObscure) // 19392 words
wordList = wordList.concat(alternatePgp) // 512 words
wordList = wordList.concat(alternatePokerware) // 5304 words
wordList = wordList.concat(alternateSimpsons) // 5000 words
wordList = wordList.concat(alternateSkey) // 2048 words
wordList = wordList.concat(alternateTrump) // 8192 words
wordList = wordList.concat(alternateVAN[0]) // 432 words
wordList = wordList.concat(alternateVAN[1]) // 373 words
wordList = wordList.concat(alternateVAN[2]) // 402 words
wordList = wordList.concat(alternateWordle) // 5790 words
wordList = wordList.concat(alternateZxcvbn) // 30000 words
wordList = wordList.concat(bitcoinEN) // 2048 words
wordList = wordList.concat(dicewareEN) // 8192 words
wordList = wordList.concat(dicewareBeale) // 7776 words
wordList = wordList.concat(dicewareNLP[0]) // 1296 words
wordList = wordList.concat(dicewareNLP[1]) // 7776 words
wordList = wordList.concat(effDistant) // 1296 words
wordList = wordList.concat(effGameOfThrones) // 4000 words
wordList = wordList.concat(effHarryPotter) // 4000 words
wordList = wordList.concat(effLong) // 7776 words
wordList = wordList.concat(effShort) // 1296 words
wordList = wordList.concat(effStarTrek) // 4000 words
wordList = wordList.concat(effStarWars) // 4000 words
wordList = wordList.concat(moneroEN) // 1626 words
wordList = wordList.concat(pseudoDibels) // 3215 words
if (selection === 'Acronyms') {
// Ensure only alphabetic characters.
wordList = wordList.filter(element => /^[a-z]+$/gi.test(element))
}
} else if (selection === 'Common Words Only') {
wordList = alternatePgp
wordList = wordList.concat(alternatePokerware)
wordList = wordList.concat(alternateVAN[0])
wordList = wordList.concat(alternateVAN[1])
wordList = wordList.concat(alternateVAN[2])
wordList = wordList.concat(alternateWordle)
wordList = wordList.concat(bitcoinEN)
wordList = wordList.concat(dicewareNLP[0])
wordList = wordList.concat(dicewareNLP[1])
wordList = wordList.concat(effDistant)
wordList = wordList.concat(effLong)
wordList = wordList.concat(effShort)
wordList = wordList.concat(moneroEN)
wordList = wordList.map(v => v.toLowerCase()) // Lowercase every character.
} else if (selection === 'Deseret Alphabet') {
wordList = alternateDeseret
} else if (selection === 'Shavian Alphabet') {
wordList = alternateShavian
} else if (selection === 'Klingon') {
wordList = alternateKlingon
} else if (selection === 'Lord of the Rings') {
wordList = alternateEyeware
} else if (selection === 'Mongolian') {
wordList = alternateMN
} else if (selection === 'Obscure') {
wordList = alternateObscure
} else if (selection === 'PGP') {
wordList = alternatePgp
} else if (selection === 'Pokerware') {
wordList = alternatePokerware
} else if (selection === 'Simpsons') {
wordList = alternateSimpsons
} else if (selection === 'Serbian') {
wordList = alternateSR
} else if (selection === 'S/KEY') {
wordList = alternateSkey
} else if (selection === 'Trump') {
wordList = alternateTrump
} else if (selection === 'Ukranian') {
wordList = alternateUK
} else if (selection === 'Verb, Adjective, Noun') {
return generateVAN()
} else if (selection === 'Wordle') {
wordList = alternateWordle
} else if (selection === 'zxcvbn') {
wordList = alternateZxcvbn
}
wordList = uniquesOnly(wordList) // Force unique elements in array.
const entropy = getEntropy()
const len = Math.ceil(entropy / Math.log2(wordList.length))
if (selection === 'Acronyms') {
/**
* This is a hack to prevent wasting too much time iterating through the
* generation process. These minimum word counts were found via generation
* of 5,000 passphrases at each of the different entropy levels and counting
* the results.
*
* See https://gist.github.com/atoponce/317d8a697b685b73d8fa31b2c0615d05
*/
let minWords = (entropy >> 3) - 2
if ([80, 88, 96, 104].indexOf(entropy) > -1) {
minWords -= 1
} else if ([112, 120, 128].indexOf(entropy) > -1) {
minWords -= 2
}
let results
do {
results = generateAcronym(minWords, wordList, altProps.entropyCheck.checked)
minWords++
} while (results.security < entropy)
pass = results.passphrase.trim()
altProps.passId.classList.add('acronym')
altProps.passId.classList.remove('colors')
altProps.passId.innerHTML = pass
altProps.passEntropy.innerText = results.security + ' bits'
altProps.passLength.innerText = pass.replace(/<\/?span>/g, '').length + ' characters'
altProps.setSize.innerText = wordList.length.toLocaleString() + ' words'
} else {
pass = generatePass(len, wordList, true, altProps.entropyCheck.checked).trim()
pass = pass.replace(/ /g, '-')
altProps.passId.classList.remove('acronym')
altProps.passId.classList.remove('colors')
altProps.passEntropy.innerText = Math.floor(len * Math.log2(wordList.length)) + ' bits'
altProps.passId.innerText = pass
altProps.passLength.innerText = [...pass].length + ' characters'
altProps.setSize.innerText = wordList.length.toLocaleString() + ' words'
}
}
/**
* Generate a passphrase built up from an acronym.
* There is some discussion that my approach might not be secure. A Mastodon
* discussion about it: https://fosstodon.org/deck/@atoponce/110839994357941432
* I'm not convinced this approach is flawed. But PR's are welcome!
* @param {Number} wordCount - The number of words in the passphrase.
* @param {Array} wordList - A list of words to choose frome.
* @param {Boolean} useEntropy - Boolean to use collected entropy.
* @return {Object} - Dictionary containing the passphrase and its security.
*/
function generateAcronym(wordCount, wordList, useEntropy) {
var getSecurity = function (entropyList) {
return Math.floor(
entropyList.reduce((total, a) => total + Math.log2(a), 0)
)
}
const candidates = []
for (let i = 0; i < wordList.length; i++) {
if (wordList[i].length === wordCount) {
candidates.push(wordList[i])
}
}
const num = secRand(candidates.length, useEntropy)
const acronym = candidates[num]
const entropies = []
const passphraseWords = []
for(let i = 0; i < acronym.length; i++) {
const candidates = []
for (let j = 0; j < wordList.length; j++) {
if (wordList[j][0].toLowerCase() === acronym[i][0].toLowerCase()) {
candidates.push("<p>" + wordList[j] + "</p>")
}
}
const word = candidates[secRand(candidates.length, useEntropy)]
passphraseWords.push(word)
entropies.push(candidates.length)
}
const security = getSecurity(entropies)
const passphrase = passphraseWords.join('-')
return {passphrase, security}
}
/** Generate a color passphrase */
function generateColors() {
let tmp = ''
const colorKeys = Object.keys(alternateColors)
const entropy = getEntropy()
const len = Math.ceil(entropy / Math.log2(colorKeys.length))
altProps.passId.classList.remove("acronym") // Ensure leading word character is not red
altProps.passId.classList.add("colors")
let pass = generatePass(len, colorKeys, true, altProps.entropyCheck.checked).split(' ')
const chosenTheme = localStorage.theme
for (let i = 0; i < len; i++) {
const hex = alternateColors[pass[i]]
if (chosenTheme === undefined || chosenTheme === 'light') {
if (isTooLight(hex)) {
tmp +=
"<span class='bold light_contrast' style='color:#" + hex + ";'>" + pass[i] + '</span> '
} else {
tmp += "<span class='bold' style='color:#" + hex + ";'>" + pass[i] + '</span> '
}
} else if (chosenTheme === 'dark') {
if (isTooDark(hex)) {
tmp +=
"<span class='bold dark_contrast' style='color:#" + hex + ";'>" + pass[i] + '</span> '
} else {
tmp += "<span class='bold' style='color:#" + hex + ";'>" + pass[i] + '</span> '
}
}
}
altProps.passId.innerHTML = tmp.replace(/> </g, '>-<').trim()
tmp = ''
for (let i = 0; i < len; i++) {
tmp += pass[i]
}
pass = tmp
const totalLen = pass.length + (len - 1)
altProps.passLength.innerText = totalLen + ' characters'
altProps.setSize.innerText = colorKeys.length.toLocaleString() + ' words'
altProps.passEntropy.innerText = Math.floor(len * Math.log2(colorKeys.length)) + ' bits'
}
/**
* Generate an SKEY passphrase.
* @return {Array} An array containing the password, its length and the entropy.
*/
function generateSKey() {
const wordList = uniquesOnly(pseudoSKey) // Force unique elements in array.
const entropy = getEntropy()
const len = Math.ceil(entropy / Math.log2(wordList.length))
let pass = ''
for (let i = 0; i < len; i++) {
pass += wordList[secRand(wordList.length, altProps.entropyCheck.checked)]
if (i !== len - 1) {
pass += '-'
}
}
return [pass, wordList.length, Math.floor(len * Math.log2(wordList.length))]
}
/** Generate a Verbs/Adjectives/Nouns passphrase */
function generateVAN() {
const entropy = getEntropy()
const wordCount = alternateVAN[0].length + alternateVAN[1].length + alternateVAN[2].length
const vanEntropy = Math.log2(alternateVAN[0].length * alternateVAN[1].length * alternateVAN[2].length)
const len = Math.ceil(entropy / vanEntropy)
let pass
let vans = []
for (let i = 0; i < len; i++) {
vans[i] = generatePass(1, alternateVAN[0], false, altProps.entropyCheck.checked)
vans[i] += generatePass(1, alternateVAN[1], false, altProps.entropyCheck.checked)
vans[i] += generatePass(1, alternateVAN[2], false, altProps.entropyCheck.checked)
}
pass = vans.join("-")
altProps.passId.innerText = pass
altProps.passEntropy.innerText = Math.floor(len * vanEntropy) + ' bits'
altProps.setSize.innerText = wordCount.toLocaleString() + ' words'
altProps.passLength.innerText = pass.length + ' characters'
}
================================================
FILE: js/cryptocurrency.js
================================================
"use strict"
const cryptoProps = {
"passId": document.getElementById('crypto-pass'),
"passLength": document.getElementById('crypto-length'),
"passEntropy": document.getElementById('crypto-entropy'),
"setSize": document.getElementById('crypto-set-size'),
"entropyCheck": document.getElementById('crypto-entropy-check'),
"passCheck": document.getElementById('crypto-check'),
}
/**
* Generate a Bitcoin BIPS39-compliant passphrase (seed). Contains checksum.
* @param {string} selection - The selection option chosen by the user.
*/
function generateBitcoin(selection) {
let pass = ''
let wordList = ''
if (selection === 'Chinese (Simp)') {
wordList = bitcoinCNSimp
} else if (selection === 'Chinese (Trad)') {
wordList = bitcoinCNTrad
} else if (selection === 'Czech') {
wordList = bitcoinCZ
} else if (selection === 'English') {
wordList = bitcoinEN
} else if (selection === 'French') {
wordList = bitcoinFR
} else if (selection === 'Italian') {
wordList = bitcoinIT
} else if (selection === 'Japanese') {
wordList = bitcoinJP
} else if (selection === 'Korean') {
wordList = bitcoinKR
} else if (selection === 'Portuguese') {
wordList = bitcoinPT
} else if (selection === 'Spanish') {
wordList = bitcoinES
}
wordList = uniquesOnly(wordList) // Force unique elements in array.
/**
* Convert 8-bit byte objects to binary strings.
* @param {Object} bytes - Unsigned 8-bit Array.
* @returns {string} Binary string.
*/
var bytesToBinary = function (bytes) {
let total = 0n
for (let i = 0; i < bytes.length; i++) {
total |= BigInt(bytes[i] * 256 ** (bytes.length - i - 1))
}
return total.toString(2)
}
/**
* The SHA-256 hash function.
* @param {Object} bytes - Unsigned 8-bit Array.
* @returns {Object} Unsigned 8-bit Array
*/
var sha256 = function (bytes) {
const crypto = window.crypto || window.msCrypto
// Note: This only works under HTTPS or localhost.
return crypto.subtle.digest('SHA-256', bytes).then(function (hash) {
return hash
})
}
const entropy = Math.ceil(getEntropy() / 32) * 32 // Multiple of 32 bits, per the bip39 spec
const entropyBuffer = new Uint8Array(Math.ceil(entropy / 8))
for (let i = 0; i < entropyBuffer.length; i++) {
entropyBuffer[i] = secRand(256, cryptoProps.entropyCheck.checked)
}
sha256(entropyBuffer).then(function (digest) {
const sha256Digest = new Uint8Array(digest)
const entropyBits = bytesToBinary(entropyBuffer).padStart(entropy, '0')
const checkBits = bytesToBinary(sha256Digest)
.padStart(256, '0')
.substring(0, 11 - (entropy % 11))
const allBits = entropyBits + checkBits
const bitWords = allBits.match(/(.{1,11})/g)
const words = bitWords.map(function (binary) {
const index = parseInt(binary, 2)
return wordList[index]
})
pass = words.join('-')
cryptoProps.passId.innerText = pass
cryptoProps.passLength.innerText = pass.length + ' characters'
cryptoProps.passEntropy.innerText = entropy + ' bits'
cryptoProps.setSize.innerText = wordList.length.toLocaleString() + ' words'
cryptoProps.passCheck.innerText = 'Integrated checksum.'
})
}
/**
* Generate a Monero-based passphrase (seed). Contains checksum.
* @param {string} selection - The selection option chosen by the user.
*/
function generateMonero(selection) {
/**
* Calculate the CRC32 of a string.
* https://gist.github.com/lenqwang/1be7b4843a580f2c1df84d5360e5e88c
* @param {string} string - The string to calculate.
* @returns {number} A 32-bit integer.
*/
var crc32 = function (str) {
let crc = 0 ^ -1
const crcTable = []
const encoder = new TextEncoder()
// Build the CRC32 table.
for (let i = 0; i < 256; i++) {
let c = i
for (let j = 0; j < 8; j++) {
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1
}
crcTable[i] = c
}
// Encode the string as raw bytes.
str = String.fromCharCode(...encoder.encode(str))
for (let i = 0; i < str.length; i++) {
crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xff]
}
return (crc ^ -1) >>> 0
}
let pass = ''
let wordList = ''
let prefixLen = 4 // Common for most languages below
if (selection === 'Chinese') {
prefixLen = 1
wordList = moneroCN
} else if (selection === 'Dutch') {
wordList = moneroNL
} else if (selection === 'English') {
prefixLen = 3
wordList = moneroEN
} else if (selection === 'Esperanto') {
wordList = moneroEO
} else if (selection === 'French') {
wordList = moneroFR
} else if (selection === 'German') {
wordList = moneroDE
} else if (selection === 'Italian') {
wordList = moneroIT
} else if (selection === 'Japanese') {
prefixLen = 3
wordList = moneroJP
} else if (selection === 'Lojban') {
wordList = moneroJBO
} else if (selection === 'Portuguese') {
wordList = moneroPT
} else if (selection === 'Russian') {
wordList = moneroRU
} else if (selection === 'Spanish') {
wordList = moneroES
}
wordList = uniquesOnly(wordList) // Force unique elements in array.
const entropy = Math.ceil(getEntropy() / 32) * 32 // Multiple of 32 bits
const len = Math.ceil(entropy / Math.log2(wordList.length))
pass = generatePass(len, wordList, true, cryptoProps.entropyCheck.checked).trim().split(' ')
let prefixes = ''
for (let i = 0; i < pass.length; i++) {
prefixes += pass[i].substring(0, prefixLen)
}
const checksum = crc32(prefixes)
const checkWord = pass[checksum % pass.length]
pass.push(checkWord)
pass = pass.join('-')
cryptoProps.passId.innerText = pass
cryptoProps.passLength.innerText = pass.length + ' characters'
cryptoProps.passEntropy.innerText = entropy + ' bits'
cryptoProps.setSize.innerText = wordList.length.toLocaleString() + ' words'
cryptoProps.passCheck.innerText = 'Integrated checksum.'
}
================================================
FILE: js/diceware.js
================================================
"use strict"
const dicewareProps = {
"passId": document.getElementById('diceware-pass'),
"passLength": document.getElementById('diceware-length'),
"passEntropy": document.getElementById('diceware-entropy'),
"setSize": document.getElementById('diceware-set-size'),
"entropyCheck": document.getElementById('diceware-entropy-check'),
}
/**
* Generate a Diceware Natural Language Passphrase, alternating adj./noun.
* @param {Array} wordList - A 2-dimensional array of adjectives and nouns.
* @param {Boolean} useEntropy - Boolean to use collected entropy.
* @return {String} - The generated password as a hyphenated string.
*/
function generateNLP(wordList, useEntropy) {
const entropy = getEntropy()
const len = Math.ceil(entropy / Math.log2(wordList[0].length)) // adjectives
const adjs = generatePass(len, wordList[0], true, useEntropy).split(' ')
const nouns = generatePass(len, wordList[1], true, useEntropy).split(' ')
const wordCount = wordList[0].length + wordList[1].length
let pass = []
let bits = 0
let counter = 0
// building up the password alternating: adj-noun-adj-noun-...
while (bits <= entropy) {
if (counter % 2 === 0) {
pass.push(adjs[counter])
bits += Math.log2(wordList[0].length)
} else {
pass.push(nouns[counter])
bits += Math.log2(wordList[1].length)
}
counter++
}
if (pass.length % 2 === 1) { // adj_1, noun_1, ..., adj_n
pass.unshift(pass.pop()) // adj_n, adj_1, noun_1, ...
}
dicewareProps.passEntropy.innerText = Math.floor(bits) + ' bits'
dicewareProps.setSize.innerText = wordCount.toLocaleString() + ' words'
return pass.join('-')
}
/**
* Generate a Diceware passphrase based on the chosen language word list.
* @param {string} selection - A Diceware language word list.
*/
function generateDiceware(selection) {
let pass = ''
let wordList = ''
if (selection === 'Basque') {
wordList = dicewareEU
} else if (selection === 'Bulgarian') {
wordList = dicewareBG
} else if (selection === 'Catalan') {
wordList = dicewareCA
} else if (selection === 'Chinese') {
wordList = dicewareCN
} else if (selection === 'Czech') {
wordList = dicewareCZ
} else if (selection === 'Danish') {
wordList = dicewareDA
} else if (selection === 'Dutch') {
wordList = dicewareNL
} else if (selection === 'English') {
wordList = dicewareEN
} else if (selection === 'English (Beale)') {
wordList = dicewareBeale
} else if (selection === 'English (NLP)') {
wordList = dicewareNLP
} else if (selection === 'Esperanto') {
wordList = dicewareEO
} else if (selection === 'Estonian') {
wordList = dicewareET
} else if (selection === 'Finnish') {
wordList = dicewareFI
} else if (selection === 'French') {
wordList = dicewareFR
} else if (selection === 'German') {
wordList = dicewareDE
} else if (selection === 'Greek') {
wordList = dicewareEL
} else if (selection === 'Hebrew') {
wordList = dicewareIW
} else if (selection === 'Hungarian') {
wordList = dicewareHU
} else if (selection === 'Italian') {
wordList = dicewareIT
} else if (selection === 'Japanese') {
wordList = dicewareJP
} else if (selection === 'Latin') {
wordList = dicewareLA
} else if (selection === 'Maori') {
wordList = dicewareMI
} else if (selection === 'Norwegian') {
wordList = dicewareNO
} else if (selection === 'Polish') {
wordList = dicewarePL
} else if (selection === 'Portuguese') {
wordList = dicewarePT
} else if (selection === 'Romanian') {
wordList = dicewareRO
} else if (selection === 'Russian') {
wordList = dicewareRU
} else if (selection === 'Slovak') {
wordList = dicewareSK
} else if (selection === 'Slovenian') {
wordList = dicewareSL
} else if (selection === 'Spanish') {
wordList = dicewareES
} else if (selection === 'Swedish') {
wordList = dicewareSV
} else if (selection === 'Turkish') {
wordList = dicewareTR
}
wordList = uniquesOnly(wordList) // Force unique elements in array.
const entropy = getEntropy()
if (selection === 'English (NLP)') {
pass = generateNLP(wordList, dicewareProps.entropyCheck.checked)
} else {
// Every other Diceware word list.
const len = Math.ceil(entropy / Math.log2(wordList.length))
pass = generatePass(len, wordList, true, dicewareProps.entropyCheck.checked).trim()
pass = pass.replace(/ /g, '-')
dicewareProps.passEntropy.innerText = Math.floor(len * Math.log2(wordList.length)) + ' bits'
dicewareProps.setSize.innerText = wordList.length.toLocaleString() + ' words'
}
dicewareProps.passId.innerText = pass
dicewareProps.passLength.innerText = pass.length + ' characters'
}
================================================
FILE: js/eff.js
================================================
"use strict"
const effProps = {
"passId": document.getElementById('eff-pass'),
"passLength": document.getElementById('eff-length'),
"passEntropy": document.getElementById('eff-entropy'),
"setSize": document.getElementById('eff-set-size'),
"entropyCheck": document.getElementById('eff-entropy-check'),
}
/**
* Generate an EFF passphrase based on the chosen word list.
* @param {string} selection - An EFF word list.
*/
function generateEff(selection) {
let pass = ''
let wordList = ''
if (selection === 'Distant Words') {
wordList = effDistant
} else if (selection === 'Short Words') {
wordList = effShort
} else if (selection === 'Long Words') {
wordList = effLong
} else if (selection === 'Game of Thrones') {
wordList = effGameOfThrones
} else if (selection === 'Harry Potter') {
wordList = effHarryPotter
} else if (selection === 'Star Trek') {
wordList = effStarTrek
} else if (selection === 'Star Wars') {
wordList = effStarWars
}
wordList = uniquesOnly(wordList) // Force unique elements in array.
const entropy = getEntropy()
const len = Math.ceil(entropy / Math.log2(wordList.length))
pass = generatePass(len, wordList, true, effProps.entropyCheck.checked).trim()
pass = pass.replace(/ /g, '-')
effProps.passId.innerText = pass
effProps.passLength.innerText = pass.length + ' characters'
effProps.setSize.innerText = wordList.length.toLocaleString() + ' words'
effProps.passEntropy.innerText = Math.floor(len * Math.log2(wordList.length)) + ' bits'
}
================================================
FILE: js/main.js
================================================
//"use strict"
// globals
const PAGECONTAINER = document.getElementsByTagName('body')[0]
const PREFERSDARKTHEME = window.matchMedia('(prefers-color-scheme: dark)')
const THEMESWITCHER = document.getElementById('theme_switcher')
const SITECOLORS = {
// added bold variants, just in case I want them later.
red: '#ff6464', redBold: '#ff3939',
orange: '#ffcb64', orangeBold: '#ffbd39',
yellow: '#ffff64', yellowBold: '#ffff39',
green: '#55d955', greenBold: '#2fcf2f',
// new blue and purple, again just in case.
blue: '#5777c0', blueBold: '#365bb0',
purple: '#9951c0', purpleBold: '#822fb0'
}
/** Provide a warning when any of the Unicode generators are chosen. */
function unicodeWarn() {
if (localStorage.getItem('unicode_warned') === null) {
document.getElementById('overlay').style.display = 'block'
localStorage.setItem('unicode_warned', true)
}
}
/** Toggle the theme to dark. Uses #000000 for OLED efficiency. */
function setDarkTheme() {
PAGECONTAINER.classList.add('dark-theme')
localStorage.setItem('theme', 'dark')
// SVG sun
THEMESWITCHER.innerHTML = `
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='currentColor' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-sun'>
<circle cx='12' cy='12' r='5'></circle>
<line x1='12' y1='1' x2='12' y2='3'></line>
<line x1='12' y1='21' x2='12' y2='23'></line>
<line x1='4.22' y1='4.22' x2='5.64' y2='5.64'></line>
<line x1='18.36' y1='18.36' x2='19.78' y2='19.78'></line>
<line x1='1' y1='12' x2='3' y2='12'></line>
<line x1='21' y1='12' x2='23' y2='12'></line>
<line x1='4.22' y1='19.78' x2='5.64' y2='18.36'></line>
<line x1='18.36' y1='5.64' x2='19.78' y2='4.22'></line>
</svg>
`
}
/** Toggle the theme to light. */
function setLightTheme() {
PAGECONTAINER.classList.remove('dark-theme')
localStorage.setItem('theme', 'light')
// SVG moon
THEMESWITCHER.innerHTML = `
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='currentColor' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-moon'>
<path d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'></path>
</svg>
`
}
/** Initialize the theme from previous setting, or default to light. */
function initTheme() {
if (localStorage.getItem('theme') === 'dark') {
// Dark Theme was set on page load because of previously set preference.
setDarkTheme()
} else if (
// Dark Theme was set on page load because of OS preference.
!localStorage.getItem('theme') &&
PREFERSDARKTHEME &&
PREFERSDARKTHEME.matches === true
) {
setDarkTheme()
} else {
// Light Theme was assumed due to page default or user preference or OS preference.
setLightTheme()
}
}
/** Toggle theme between light and dark. */
function toggleTheme() {
if (PAGECONTAINER.classList.contains('dark-theme')) {
setLightTheme()
} else {
setDarkTheme()
}
}
/** Return selected entropy (56, 64, 72, 80, 88, 96, 104, 112, 120, or 128). */
function getEntropy() {
return parseInt(document.querySelector('#output').value)
}
/**
* Return a word list from the Alternate, Bitcoin, Diceware, or EFF generator.
* @param {string} source - The selected passphrase wordlist.
* @return {string} - The HTML selected option.
*/
function getSourceList(source) {
let sourceList
if (source === 'alternate') {
sourceList = document.getElementById('alt-options').value
} else if (source === 'cryptocurrency') {
sourceList = document.getElementById('cryptocurrency-options').value
} else if (source === 'diceware') {
sourceList = document.getElementById('diceware-options').value
} else if (source === 'eff') {
sourceList = document.getElementById('eff-options').value
}
return sourceList
}
/**
* Generate a passphrase based on the button the user presses.
* @param {string} source - The selected passphrase generator.
*/
function generatePassphrase(source) {
const sourceList = getSourceList(source)
if (source === 'alternate') {
generateAlternate(sourceList)
} else if (source === 'cryptocurrency') {
const optGroup = document.querySelector('#cryptocurrency-options option:checked').parentElement.label
if (optGroup === 'Bitcoin') {
generateBitcoin(sourceList)
} else if (optGroup === 'Monero') {
generateMonero(sourceList)
}
} else if (source === 'diceware') {
generateDiceware(sourceList)
} else if (source === 'eff') {
generateEff(sourceList)
}
}
/**
* Toggle the visibility of the cell overflow div for password stats.
* @param {String} source - One of the six generator cells.
*/
function toggleStats(source) {
let elem
const coords = {left: scrollX, top: scrollY, behavior: 'instant'}
if (source === 'alternate') {
elem = document.getElementById('alt-overlay')
} else if (source == 'cryptocurrency') {
elem = document.getElementById('crypto-overlay')
} else if (source == 'diceware') {
elem = document.getElementById('diceware-overlay')
} else if (source == 'eff') {
elem = document.getElementById('eff-overlay')
} else if (source == 'pseudo') {
elem = document.getElementById('pseudo-overlay')
} else if (source == 'random') {
elem = document.getElementById('random-overlay')
}
// Toggling the div display in CSS scrolls to the top of the page. I don't
// want to lock scrolling, as the user may want to still scroll after looking
// at the stats. So CSS "overflow: hidden;" isn't going to work. Neither will
// some disableScroll() and enableScroll() functions.
if (elem.style.display === '') {
elem.style.display = 'block'
} else {
elem.style.display = ''
}
// So this hack scrolls back to our previous position, but won't without a
// timeout. Requires ~10 ms to work in Firefox consistently. Unfortunately,
// this can create a quick page blink in the UI, which isn't great.
// I really hate this, but it works.
setTimeout(function() {scrollTo(coords)}, 10)
}
/**
* Add a checkbox to use entropy if its present in localStorage.entropy.
* Mozilla will not store localStorage key values to disk under the file:// protocol.
* See https://bugzilla.mozilla.org/show_bug.cgi?id=507361 for more information.
*/
function toggleEntropyVisibility() {
const classes = document.getElementsByClassName('use-entropy')
if (localStorage.hasOwnProperty('entropy')) {
if (JSON.parse(localStorage.entropy).length > 0) {
for (let i = 0; i < classes.length; i++) {
classes[i].style.visibility = 'visible'
classes[i].children[2].innerText = JSON.parse(localStorage.entropy).length
}
} else {
for (let i = 0; i < classes.length; i++) {
classes[i].style.visibility = 'hidden'
}
}
}
}
/**
* A cryptographically secure uniform random number generator.
* @param {number} count - The max number a random number can be.
* @param {boolean} useEntropy - Whether or not to use the data in localStorage.entropy.
* @return {number} - Uniform random number.
*/
function secRand(count, useEntropy) {
let num = 0
const min = 2 ** 32 % count
const rand = new Uint32Array(1)
if (useEntropy) {
const entropy = JSON.parse(localStorage.entropy)
if (entropy.length > 0) {
num = entropy[0]
entropy.shift()
localStorage.entropy = JSON.stringify(entropy)
}
}
do {
num ^= crypto.getRandomValues(rand)[0]
} while (num < min)
toggleEntropyVisibility()
return num % count
}
/**
* Remove any and all duplicates from an array. Case sensitive.
* @param {Array} list - An array of strings or numbers which might contain duplicates.
* @return {Array} - The array with duplicates removed.
*/
function uniquesOnly(list) {
return [...new Set(list)] // enforce unique elements in array
}
/**
* The critical password generation function. Generates a password from a given set of data.
* @param {number} len - How many characters/words to pick.
* @param {string|Array} set - The data set to pick from.
* @param {boolean} spaces - Whether or not to space-separate the password.
* @param {boolean} useEntropy - Whether or not to use save entropy in localStorage.entropy.
* @return {string} - The generated password.
*/
function generatePass(len, set, spaces, useEntropy) {
let pass = ''
let passArr = ''
if (typeof set === 'string') {
passArr = set.split('')
} else {
passArr = set
}
for (let i = len; i > 0; i--) {
if (useEntropy) {
if (spaces) {
pass += passArr[secRand(set.length, true)]
pass += ' '
} else {
pass += passArr[secRand(set.length, true)]
}
} else {
if (spaces) {
pass += passArr[secRand(set.length, false)]
pass += ' '
} else {
pass += passArr[secRand(set.length, false)]
}
}
}
return pass
}
/**
* Determine if the color name needs to be outlined with CSS.
* @param {number} hex - The hex value of the color.
* @return {boolean} - true if color is too dark, false if light enough.
*/
function isTooDark(hex) {
const rgb = parseInt(hex, 16)
const r = (rgb >> 16) & 0xff
const g = (rgb >> 8) & 0xff
const b = (rgb >> 0) & 0xff
const l = 0.299 * r + 0.587 * g + 0.114 * b
if (l > 79) {
return false
}
return true
}
/**
* Determine if the color name needs to be outlined with CSS.
* @param {number} hex - The hex value of the color.
* @return {boolean} -true if the color is too light, false if dark enough
*/
function isTooLight(hex) {
const rgb = parseInt(hex, 16)
const r = (rgb >> 16) & 0xff
const g = (rgb >> 8) & 0xff
const b = (rgb >> 0) & 0xff
const l = 0.299 * r + 0.587 * g + 0.114 * b
if (l < 176) {
return false
}
return true
}
/**
* Add entropy from an external source, such as an HWRNG.
* @param {string} hex - Hexadecimal input
*/
function addEntropy(hex) {
var isHex = function(hex) {
return typeof hex === 'string' && hex.length % 4 === 0 && !isNaN(Number('0x' + hex))
}
if (isHex(hex)) {
let entropy = JSON.parse(localStorage.entropy)
let lifetimeBits = JSON.parse(localStorage.lifetimeBits)
for (let i = 0; i < hex.length; i+=4) {
let num = hex.substring(i, i+4)
entropy.push(parseInt(num, 16))
}
localStorage.lifetimeBits = JSON.stringify(lifetimeBits + hex.length * 4)
localStorage.entropy = JSON.stringify(entropy)
} else {
console.error('Argument must be a hex string with a length that is a multple of 4 characters.')
}
}
/**
* An input slider ranging from values 48 to 128 stepping every 8.
* @param {number} integer - An 8-bit value
*/
function updateSlider(n) {
const slider = document.getElementById('input')
const passClass = document.getElementsByClassName('password')
for (let i = 0; i < 6; i++) {
passClass[i].classList.remove('p48')
passClass[i].classList.remove('p56')
passClass[i].classList.remove('p64')
passClass[i].classList.remove('p72')
}
if (n === 48) {
slider.style.setProperty('--track-background', SITECOLORS.red)
for (let i = 0; i < 6; i++) {
passClass[i].classList.add('p48')
}
} else if (n === 56) {
slider.style.setProperty('--track-background', SITECOLORS.orange)
for (let i = 0; i < 6; i++) {
passClass[i].classList.add('p56')
}
} else if (n === 64) {
slider.style.setProperty('--track-background', SITECOLORS.yellow)
for (let i = 0; i < 6; i++) {
passClass[i].classList.add('p64')
}
} else if (n >= 72) {
slider.style.setProperty('--track-background', SITECOLORS.green)
for (let i = 0; i < 6; i++) {
passClass[i].classList.add('p72')
}
}
document.querySelector('#output').value = n
localStorage.setItem('security', n)
}
/** Update localStorage with a key-value of the selected security margin when using the slider. */
function setSecurity() {
if (localStorage.getItem('security') === null) {
localStorage.setItem('security', 72)
}
const security = parseInt(localStorage.getItem('security'))
document.querySelector('#output').value = security
document.querySelector('input[type=range]').value = security
updateSlider(security)
}
/** Generate all passwords (called from index.html only on page load/refresh). */
function loadPasses() {
generatePassphrase('alternate')
generatePassphrase('cryptocurrency')
generatePassphrase('diceware')
generatePassphrase('eff')
generatePseudowords()
generateRandom()
}
/** Sets a session storage variable */
function mork() {
let str = ''
window.addEventListener('keydown', function(e) {
str = (str + e.key).substr(-4)
if (str === 'mork') {
sessionStorage.setItem('mork', true)
}
}, false
)
}
================================================
FILE: js/pseudowords.js
================================================
"use strict"
const pseudoProps = {
"passId": document.getElementById('pseudo-pass'),
"passLength": document.getElementById('pseudo-length'),
"passEntropy": document.getElementById('pseudo-entropy'),
"setSize": document.getElementById('pseudo-set-size'),
"passCheck": document.getElementById('pseudo-check'),
"entropyCheck": document.getElementById('pseudo-entropy-check')
}
/** Generate a pseudowords password. */
function generatePseudowords() {
let ret = []
let displayCheck = false
const pseudo = document.getElementById('pseudo-options').value
if (pseudo === 'Apple Keychain') {
ret = generateApple()
pseudoProps.setSize.innerHTML = "It's <a href='https://github.com/atoponce/webpassgen/blob/5598bb9dbc3658d33ec4b58b800a62d410571940/js/pseudowords.js#L65-L82'>complicated</a>"
} else if (pseudo === 'Bubble Babble') {
ret = generateBabble()
displayCheck = true
pseudoProps.setSize.innerText = "65,536 pseudowords"
} else if (pseudo === 'Daefen') {
ret = generateDaefen()
pseudoProps.setSize.innerText = "3,456 syllables"
} else if (pseudo === 'DIBELS') {
ret = generateDibels()
pseudoProps.setSize.innerText = pseudoDibels.length.toLocaleString() + " pseudowords"
} else if (pseudo === 'Koremutake') {
ret = generateKoremutake()
pseudoProps.setSize.innerText = "128 syllables"
} else if (pseudo === 'Lepron') {
ret = generateLepron()
pseudoProps.setSize.innerText = "362,797,056 pseudowords"
} else if (pseudo === 'Letterblock Diceware') {
ret = generateLetterblock()
displayCheck = true
pseudoProps.setSize.innerText = '1,679,616 blocks'
} else if (pseudo === 'Munemo') {
ret = generateMunemo()
pseudoProps.setSize.innerText = "100 syllables"
} else if (pseudo === 'Proquints') {
ret = generateProquints()
pseudoProps.setSize.innerText = "65,536 pseudowords"
} else if (pseudo === 'Urbit') {
ret = generateUrbit()
pseudoProps.setSize.innerText = "65,536 pseudowords"
}
const pass = ret[0]
const ent = ret[1]
pseudoProps.passId.innerText = pass
pseudoProps.passLength.innerText = pass.length + ' characters'
pseudoProps.passEntropy.innerText = ent + ' bits'
if (displayCheck) {
pseudoProps.passCheck.innerText = 'Integrated checksum.'
} else {
pseudoProps.passCheck.innerText = ''
}
}
/**
* Generate a Keychain formatted password.
* @return {Array} The password string, the length of the password, and the entropy of the password.
*/
function generateApple() {
/**
* Calculate the entropy of an Apple password containing n-blocks.
* @param {number} n - The number of blocks in the password.
* @return {number} Entropy in bits.
*/
var apple = function (n) {
/*
See https://web.archive.org/web/20210430183515/https://twitter.com/AaronToponce/status/1131406726069084160 for full analysis.
For n ≥ 1 blocks, the entropy in bits per block is:
log2(
(6n - 1) // One lowercase alphabetic character is randomly capitalized
* 19^(4n - 1) // The total possible combinations of consonants
* 6^(2n) // The total possible combinations of vowels
* 10 * 2n // An 'edge' character is a random digit
)
E.G.:
DVccvc: log2( 5 * 19^3 * 6^2 * 10 * 2) ~= 24.558 bits
cvCcvD-cvccvc: log2(11 * 19^7 * 6^4 * 10 * 4) ~= 48.857 bits
cvcCvc-Dvccvc-cvccvc: log2(17 * 19^11 * 6^6 * 10 * 6) ~= 72.231 bits
cvccVc-cvccvD-cvccvc-cvccvc: log2(23 * 19^15 * 6^8 * 10 * 8) ~= 95.244 bits
et cetera, et cetera, et cetera.
*/
return Math.floor(Math.log2((6 * n - 1) * 19 ** (4 * n - 1) * 6 ** (2 * n) * 20 * n))
}
const pass = []
const digits = '0123456789'
const vowels = 'aeiouy'
const consonants = 'bcdfghjkmnpqrstvwxz'
const entropy = getEntropy()
let n = 1 // number of blocks
while (apple(n) < entropy) {
n++
}
for (let i = 0; i < n; i++) {
pass[6 * i] = generatePass(1, consonants, false, pseudoProps.entropyCheck.checked)
pass[6 * i + 1] = generatePass(1, vowels, false, pseudoProps.entropyCheck.checked)
pass[6 * i + 2] = generatePass(1, consonants, false, pseudoProps.entropyCheck.checked)
pass[6 * i + 3] = generatePass(1, consonants, false, pseudoProps.entropyCheck.checked)
pass[6 * i + 4] = generatePass(1, vowels, false, pseudoProps.entropyCheck.checked)
pass[6 * i + 5] = generatePass(1, consonants, false, pseudoProps.entropyCheck.checked)
}
let digitLoc = 0
let charLoc = 0
const edge = secRand(2 * n, pseudoProps.entropyCheck.checked) // [0, 2n)
const digit = generatePass(1, digits, false, pseudoProps.entropyCheck.checked)
if (edge % 2 === 0) {
digitLoc = 3 * edge
} else {
digitLoc = 3 * edge + 2
}
pass[digitLoc] = digit
do {
charLoc = secRand(pass.length, pseudoProps.entropyCheck.checked)
} while (charLoc === digitLoc)
pass[charLoc] = pass[charLoc].toUpperCase()
for (let i = n - 1; i > 0; i--) {
pass.splice(6 * i, 0, '-')
}
return [pass.join(''), apple(n)]
}
/**
* Generate a Bubble Babble compliant password. Contains checksum.
* @return {Array} The password string, the length of the password, and the entropy of the password.
*/
function generateBabble() {
// Spec: https://web.mit.edu/kenta/www/one/bubblebabble/spec/jrtrjwzi/draft-huima-01.txt
// Code based on https://github.com/kpalin/bubblepy
const vowels = 'aeiouy'
const consonants = 'bcdfghklmnprstvzx'
const bytes = Math.ceil(getEntropy() / 8)
const entropy = new Uint8Array(bytes)
let pass = 'x'
let checksum = 1
for (let i = 0; i < entropy.length; i++) {
entropy[i] = secRand(256, pseudoProps.entropyCheck.checked)
}
for (let i = 0; i <= entropy.length; i += 2) {
if (i >= entropy.length) {
pass += vowels[checksum % 6] + consonants[16] + vowels[Math.floor(checksum / 6)]
break
}
const byte1 = entropy[i]
pass += vowels[(((byte1 >> 6) & 3) + checksum) % 6]
pass += consonants[(byte1 >> 2) & 15]
pass += vowels[((byte1 & 3) + Math.floor(checksum / 6)) % 6]
if (i + 1 >= entropy.length) {
break
}
const byte2 = entropy[i + 1]
pass += consonants[(byte2 >> 4) & 15]
pass += '-'
pass += consonants[byte2 & 15]
checksum = (checksum * 5 + byte1 * 7 + byte2) % 36
}
pass += 'x'
return [pass, entropy.length * 8]
}
/**
* Generate a Daefen-compliant password.
* @return {Array} An array containing the password, its length, and the entropy.
*/
function generateDaefen() {
const syllables = []
const consonants = 'bcdfghjklmnprstvwz'
const vowels = 'aeiouy'
const entropy = getEntropy()
let pass = ''
// taken from https://github.com/alexvandesande/Daefen/blob/master/index.js
// vowel + consonant
for (let i = 0; i < vowels.length; i++) {
for (let j = 0; j < consonants.length; j++) {
syllables.push(vowels[i] + consonants[j])
}
}
// consonant + vowel
for (let i = 0; i < consonants.length; i++) {
for (let j = 0; j < vowels.length; j++) {
syllables.push(consonants[i] + vowels[j])
}
}
// consonant + vowel + vowel
for (let i = 0; i < consonants.length; i++) {
for (let j = 0; j < vowels.length; j++) {
for (let k = 0; k < vowels.length; k++) {
syllables.push(consonants[i] + vowels[j] + vowels[k])
}
}
}
// consonant + vowel + consonant
for (let i = 0; i < consonants.length; i++) {
for (let j = 0; j < vowels.length; j++) {
for (let k = 0; k < consonants.length; k++) {
syllables.push(consonants[i] + vowels[j] + consonants[k])
}
}
}
// vowel + consonant + vowel
for (let i = 0; i < vowels.length; i++) {
for (let j = 0; j < consonants.length; j++) {
for (let k = 0; k < vowels.length; k++) {
syllables.push(vowels[i] + consonants[j] + vowels[k])
}
}
}
const len = Math.ceil(entropy / Math.log2(syllables.length)) // 16 bits per "word"
/**
* Determine if the letter is a conosonant.
* @param {string} letter - A letter to be added to the password.
* @return True if the letter is a consonant, false if it is a vowel.
*/
var isConsonant = function (letter) {
return consonants.indexOf(letter) >= 0
}
for (let i = 0; i < len; i ++) {
let n = secRand(syllables.length, pseudoProps.entropyCheck.checked)
let lastWord = pass.split('-').slice(-1)[0]
if (
pass === '' || lastWord.length === syllables[n].length ||
(
lastWord.length < 5 &&
isConsonant(lastWord.slice(-1)) &&
isConsonant(syllables[n].slice(0, 1))
)) {
pass += syllables[n]
} else {
pass += '-' + syllables[n]
}
}
pass = pass.replace(/\b[a-z]/g, function(f) {
return f.toUpperCase()
})
return [pass, Math.floor(len * Math.log2(syllables.length))]
}
/**
* Generate a DIBELS password.
* @return {Array} The password string, the length of the password, and the entropy of the password.
*/
function generateDibels() {
// Word lists taken from:
// - 6th edition progress monitoring materials: https://web.archive.org/web/20191102033345/https://dibels.uoregon.edu/assessment/index/materialdownload?agree=true#dibels
// - 8th edition benchmark materials: https://dibels.uoregon.edu/materials/dibels#materials
// - 8th edition progress monitoring materials: https://dibels.uoregon.edu/materials/dibels#progress
// - Acadia Learning (formerly DIBELS Next): https://acadiencelearning.org/acadience-learning-online-materials-download/
// Only grades K-3 contain Nonsense Word Fluency (NWF) words
const wordList = uniquesOnly(pseudoDibels)
const entropy = getEntropy()
const wordCount = Math.ceil(entropy / Math.log2(wordList.length))
let pass = generatePass(wordCount, wordList, true, pseudoProps.entropyCheck.checked).trim()
pass = pass.replace(/ /g, '-')
return [pass, Math.floor(wordCount * Math.log2(wordList.length))]
}
/**
* Generate a Munemo password.
* @return {Array} The password string, the length of the password, and the entropy of the password.
*/
function generateMunemo() {
// https://github.com/jmettraux/munemo
/**
* Recursive function to build an encoded string from a given number.
* @param {number} num - The number to encode.
* @param {string} str - The encoded string.
* @return {string} The encoded string.
*/
var tos = function (num, str) {
const munemo = [
'ba', 'bi', 'bu', 'be', 'bo', 'cha', 'chi', 'chu', 'che', 'cho',
'da', 'di', 'du', 'de', 'do', 'fa', 'fi', 'fu', 'fe', 'fo',
'ga', 'gi', 'gu', 'ge', 'go', 'ha', 'hi', 'hu', 'he', 'ho',
'ja', 'ji', 'ju', 'je', 'jo', 'ka', 'ki', 'ku', 'ke', 'ko',
'la', 'li', 'lu', 'le', 'lo', 'ma', 'mi', 'mu', 'me', 'mo',
'na', 'ni', 'nu', 'ne', 'no', 'pa', 'pi', 'pu', 'pe', 'po',
'ra', 'ri', 'ru', 're', 'ro', 'sa', 'si', 'su', 'se', 'so',
'sha', 'shi', 'shu', 'she', 'sho', 'ta', 'ti', 'tu', 'te', 'to',
'tsa', 'tsi', 'tsu', 'tse', 'tso', 'wa', 'wi', 'wu', 'we', 'wo',
'ya', 'yi', 'yu', 'ye', 'yo', 'za', 'zi', 'zu', 'ze', 'zo'
]
const mod = num % 100n
const rem = num / 100n
str += munemo[mod]
if (rem > 0) {
return tos(rem, str)
}
return str
}
const minEntropy = getEntropy()
const isNegative = secRand(2, pseudoProps.entropyCheck.checked)
let num = 0n
// Half the key space is negative, half is non-negative
for (let i = 0; i < minEntropy - 1; i++) {
num += BigInt(secRand(2, pseudoProps.entropyCheck.checked) * 2 ** i)
}
let pass = tos(num, '')
if (isNegative) {
// 'xa' = -1 * num:
// fowohazehikorawihomeho = 1989259826396086294829
// xafowohazehikorawihomeho = -1989259826396086294829
pass = 'xa' + pass
}
return [pass, minEntropy]
}
/**
* Generate a Koremutake password.
* @return {Array} The password string, the length of the password, and the entropy of the password.
*/
function generateKoremutake() {
// https://shorl.com/koremutake.php
/**
* Recursive function to build an encoded string from a given number.
* @param {number} num - The number to encode.
* @param {string} str - The encoded string.
* @return {string} The encoded string.
*/
var tos = function (num, str) {
const koremutake = [
'ba', 'be', 'bi', 'bo', 'bu', 'by', 'da', 'de',
'di', 'do', 'du', 'dy', 'fa', 'fe', 'fi', 'fo',
'fu', 'fy', 'ga', 'ge', 'gi', 'go', 'gu', 'gy',
'ha', 'he', 'hi', 'ho', 'hu', 'hy', 'ja', 'je',
'ji', 'jo', 'ju', 'jy', 'ka', 'ke', 'ki', 'ko',
'ku', 'ky', 'la', 'le', 'li', 'lo', 'lu', 'ly',
'ma', 'me', 'mi', 'mo', 'mu', 'my', 'na', 'ne',
'ni', 'no', 'nu', 'ny', 'pa', 'pe', 'pi', 'po',
'pu', 'py', 'ra', 're', 'ri', 'ro', 'ru', 'ry',
'sa', 'se', 'si', 'so', 'su', 'sy', 'ta', 'te',
'ti', 'to', 'tu', 'ty', 'va', 've', 'vi', 'vo',
'vu', 'vy', 'bra', 'bre', 'bri', 'bro', 'bru', 'bry',
'dra', 'dre', 'dri', 'dro', 'dru', 'dry', 'fra', 'fre',
'fri', 'fro', 'fru', 'fry', 'gra', 'gre', 'gri', 'gro',
'gru', 'gry', 'pra', 'pre', 'pri', 'pro', 'pru', 'pry',
'sta', 'ste', 'sti', 'sto', 'stu', 'sty', 'tra', 'tre'
]
const mod = num % 128n
const rem = num / 128n
str += koremutake[mod]
if (rem > 0) {
return tos(rem, str)
}
return str
}
const minEntropy = getEntropy()
let num = 0n
// Unlike Munemo, Koremutake encodes unsigned integers.
for (let i = 0; i < minEntropy; i++) {
num += BigInt(secRand(2, pseudoProps.entropyCheck.checked) * 2 ** i)
}
let pass = tos(num, '')
return [pass, minEntropy]
}
/**
* Generate a Lepron pseudoword password.
* @return {Array} The password string, the length of the password, and the entropy of the password.
*/
function generateLepron() {
// https://www.cambridgeclarion.org/34.html
const start = [
['c','cp'], ['b','bh'], ['p','xm'], ['d','bs'], ['r','ts'], ['s','chl'],
['m','kh'], ['l','dw'], ['t','kl'], ['h','kr'], ['f','chr'], ['g','ps'],
['n','x'], ['w','sch'], ['v','gn'], ['j','gh'], ['pr','spl'], ['st','shr'],
['tr','spr'], ['ch','sk'], ['br','kn'], ['fl','squ'], ['cr','thr'], ['gr','tw'],
['k','rh'], ['sh','scr'], ['qu','sm'], ['fr','ph'], ['bl','wr'], ['sp','str'],
['cl','sn'], ['dr','sw'], ['sl','z'], ['pl','th'], ['y','sc'], ['gl','wh'],
]
const vowel = [
['a'], ['e'], ['i'], ['o'], ['u', 'oi'], ['ee', 'ea', 'au', 'ua', 'ya', 'y', 'oo', 'ai', 'io']
]
const middle = [
['t', 'mpl'], ['l', 'nf'], ['r', 'gg'], ['n', 'nv'], ['m', 'lt'], ['v', 'dd'],
['c', 'rb'], ['d', 'bb'], ['s', 'ch'], ['g', 'rl'], ['p', 'pl'], ['b', 'pr'],
['st', 'sp'], ['ll', 'sh'], ['nt', 'bl'], ['nd', 'str'], ['ss', 'rs'], ['rr', 'br'],
['w', 'gn'], ['f', 'rg'], ['mp', 'tr'], ['ct', 'j'], ['rt', 'cr'], ['tt', 'cc'],
['mb', 'y'], ['ff', 'rc'], ['x', 'gr'], ['h', 'rd'], ['th', 'pt'], ['nn', 'nc'],
['qu', 'ph'], ['rm', 'pp'], ['sc', 'k'], ['ns', 'rn'], ['mm', 'ng'], ['z', 'ck'],
]
const end = [
['r', 'rry'], ['n', 'gh'], ['t', 'wl'], ['l', 'lk'], ['te', 'nge'], ['nt', 'ft'],
['m', 'sk'], ['d', 'wn'], ['s', 'na'], ['re', 'be'], ['ne', 'gy'], ['p', 'rm'],
['st', 'ny'], ['y', 'cs'], ['w', 'sm'], ['se', 'nch'], ['ck', 'f'], ['nd', 'ld'],
['ll', 'dge'], ['ry', 'ght'], ['de', 'rk'], ['ss', 'ze'], ['c', 'th'], ['ve', 'ff'],
['g', 'ch'], ['le', 'ble'], ['nce', 'rn'], ['sh', 'tch'], ['ty', 'mp'], ['ce', 'lt'],
['ge', 'pe'], ['ng', 'nk'], ['ct', 'k'], ['b', 'ke'], ['me', 'rd'], ['rt', 'x'],
]
const entropy = getEntropy()
const minEntropy = Math.log2(36 ** 4 * 6 ** 3)
// <start><vowel><middle><vowel><middle><vowel><end>
const len = Math.ceil(entropy / minEntropy)
let pass = []
// There is probably a cleaner way to do this, but at least it's readable.
for (let i = 0; i < len; i++) {
let idx1 = secRand(start.length, pseudoProps.entropyCheck.checked)
let idx2 = secRand(start[idx1].length, pseudoProps.entropyCheck.checked)
let tmp = start[idx1][idx2]
idx1 = secRand(vowel.length, pseudoProps.entropyCheck.checked)
idx2 = secRand(vowel[idx1].length, pseudoProps.entropyCheck.checked)
tmp += vowel[idx1][idx2]
idx1 = secRand(middle.length, pseudoProps.entropyCheck.checked)
idx2 = secRand(middle[idx1].length, pseudoProps.entropyCheck.checked)
tmp += middle[idx1][idx2]
idx1 = secRand(vowel.length, pseudoProps.entropyCheck.checked)
idx2 = secRand(vowel[idx1].length, pseudoProps.entropyCheck.checked)
tmp += vowel[idx1][idx2]
idx1 = secRand(middle.length, pseudoProps.entropyCheck.checked)
idx2 = secRand(middle[idx1].length, pseudoProps.entropyCheck.checked)
tmp += middle[idx1][idx2]
idx1 = secRand(vowel.length, pseudoProps.entropyCheck.checked)
idx2 = secRand(vowel[idx1].length, pseudoProps.entropyCheck.checked)
tmp += vowel[idx1][idx2]
idx1 = secRand(end.length, pseudoProps.entropyCheck.checked)
idx2 = secRand(end[idx1].length, pseudoProps.entropyCheck.checked)
tmp += end[idx1][idx2]
pass.push(tmp)
}
pass = pass.join('-')
return [pass, Math.floor(len * minEntropy)]
}
/**
* Generate a Letterblock password. Contains checksum.
* @return {Array} The password string, the length of the password, and the entropy of the password.
*/
function generateLetterblock() {
// https://www.draketo.de/software/letterblock-diceware
// Diverged from above with:
// - '$' and '%' appended to make the checksum delimiters 6 characters
// - Treating digits as leet-speak
/**
* Determines if the string is a digit.
* @param {string} str - The string to check.
* @return True if the string is a digit, false otherwise.
*/
var isDigit = function (str) {
return str.length === 1 && str.match(/[0-9]/)
}
/**
* Replace a string with a leet-speak version.
* @param {string} str - A stringified number.
* @return A leet-speak version of the number.
*/
var replaceDigit = function (str) {
if (str === '0') {
return 'o'
} else if (str === '1') {
return 'l'
} else if (str === '2') {
return 'z'
} else if (str === '3') {
return 'e'
} else if (str === '4') {
return 'a'
} else if (str === '5') {
return 's'
} else if (str === '6') {
return 'b'
} else if (str === '7') {
return 't'
} else if (str === '8') {
return 'b'
} else if (str === '9') {
return 'g'
}
}
/**
* A recursive function to build a cross-product array of strings based on the contents of "arr".
* @param {Array} arr - An array of four random strings from the "letters" multi-dimensional array.
* @param {Array} res - The cross-product of the elements on "arr".
* @param {number} ctr - A counter to keep track of the number of digits in the string.
*/
var getCombos = function (arr, res, ctr) {
const ptr0 = ctr.toString(2).padStart(4, '0')[0] // most significant bit in bin(ctr)
const ptr1 = ctr.toString(2).padStart(4, '0')[1]
const ptr2 = ctr.toString(2).padStart(4, '0')[2]
const ptr3 = ctr.toString(2).padStart(4, '0')[3] // least significant bit in bin(ctr)
if (
arr[0][ptr0] !== undefined &&
arr[1][ptr1] !== undefined &&
arr[2][ptr2] !== undefined &&
arr[3][ptr3] !== undefined
) {
res.push(arr[0][ptr0] + arr[1][ptr1] + arr[2][ptr2] + arr[3][ptr3]) // the cross-product of "arr"
}
ctr++
if (ctr < 16) { // 0 ('0000') through 15 ('1111')
getCombos(arr, res, ctr)
}
}
/**
* Get the highest weighted bigram in the array.
* @param {Array} arr - An array of bigram candidates.
* @return The highest weighted bigram.
*/
var calculateScores = function (arr) {
let results = {}
for (let i = 0; i < arr.length; i++) {
let str = arr[i]
let score = 0
for (let j = 0; j < str.length - 1; j++) {
if (isDigit(str[j])) {
score += bigrams[replaceDigit(str[j]) + str[j + 1].toLowerCase()]
} else if (isDigit(str[j + 1])) {
score += bigrams[str[j].toLowerCase() + replaceDigit(str[j + 1])]
} else {
score += bigrams[str[j].toLowerCase() + str[j + 1].toLowerCase()]
}
}
results[str] = score
}
return Object.keys(results).reduce(function (a, b) {
if (results[a] > results[b]) {
return a
}
return b
})
}
const entropy = getEntropy()
const letters = [
['1', 'A', 'J', 'a', 'h', 'px'],
['26', 'BC', 'LR', 'bc', 'i', 'r'],
['37', 'DH', 'N', 'd', 'j', 't'],
['48', 'E', 'PX', 'e', 'k', 'u'],
['59', 'FK', 'U', 'f', 'm', 'v'],
['0', 'QM', 'VW', 'gq', 'o', 'w']
]
const delimiters = '.+-=@%'
const blockEntropy = Math.log2(36 ** 4)
const numBlocks = Math.ceil(entropy / blockEntropy)
const totalEntropy = Math.floor(numBlocks * blockEntropy)
const blocks = []
const checks = []
let pass = ''
for (let i = 0; i < numBlocks; i++) {
const jail = []
const combos = []
let block = ''
let check = 0
for (let j = 0; j < 4; j++) {
const randNum = secRand(36, pseudoProps.entropyCheck.checked)
const row = Math.floor(randNum / 6)
const col = randNum % 6
let cell = letters[row][col]
jail.push(cell)
check += row + 1 // Indexed at 1 per the original proposal
}
getCombos(jail, combos, 0)
let winner = calculateScores(combos)
blocks.push(winner)
checks.push(check)
}
for (let i = 0; i < blocks.length; i++) {
pass += blocks[i]
if (checks[i + 1] !== undefined) {
pass += delimiters[(checks[i] + checks[i + 1]) % 6]
}
}
return [pass, totalEntropy]
}
/**
* Generate a Proquints-compliant password.
* @return {Array} The password string, the length of the password, and the entropy of the password.
*/
function generateProquints() {
// https://arxiv.org/html/0901.4016
const vowels = 'aiou'
const consonants = 'bdfghjklmnprstvz'
const entropy = getEntropy()
const len = Math.ceil(entropy / 16)
let pass = consonants[secRand(16, pseudoProps.entropyCheck.checked)]
for (let i = len; i > 0; i--) {
pass += vowels[secRand(4, pseudoProps.entropyCheck.checked)]
pass += consonants[secRand(16, pseudoProps.entropyCheck.checked)]
pass += vowels[secRand(4, pseudoProps.entropyCheck.checked)]
if (i === 1) {
break
}
pass += consonants[secRand(16, pseudoProps.entropyCheck.checked)]
pass += '-'
pass += consonants[secRand(16, pseudoProps.entropyCheck.checked)]
}
pass += consonants[secRand(16, pseudoProps.entropyCheck.checked)]
return [pass, len * 16]
}
/**
* Generate an Urbit phonetic password.
* @return {Array} An array containing the password, its length, and the entropy.
*/
function generateUrbit() {
const prefixes = [
"doz", "mar", "bin", "wan", "sam", "lit", "sig", "hid", "fid", "lis", "sog", "dir", "wac", "sab", "wis", "sib",
"rig", "sol", "dop", "mod", "fog", "lid", "hop", "dar", "dor", "lor", "hod", "fol", "rin", "tog", "sil", "mir",
"hol", "pas", "lac", "rov", "liv", "dal", "sat", "lib", "tab", "han", "tic", "pid", "tor", "bol", "fos", "dot",
"los", "dil", "for", "pil", "ram", "tir", "win", "tad", "bic", "dif", "roc", "wid", "bis", "das", "mid", "lop",
"ril", "nar", "dap", "mol", "san", "loc", "nov", "sit", "nid", "tip", "sic", "rop", "wit", "nat", "pan", "min",
"rit", "pod", "mot", "tam", "tol", "sav", "pos", "nap", "nop", "som", "fin", "fon", "ban", "mor", "wor", "sip",
"ron", "nor", "bot", "wic", "soc", "wat", "dol", "mag", "pic", "dav", "bid", "bal", "tim", "tas", "mal", "lig",
"siv", "tag", "pad", "sal", "div", "dac", "tan", "sid", "fab", "tar", "mon", "ran", "nis", "wol", "mis", "pal",
"las", "dis", "map", "rab", "tob", "rol", "lat", "lon", "nod", "nav", "fig", "nom", "nib", "pag", "sop", "ral",
"bil", "had", "doc", "rid", "moc", "pac", "rav", "rip", "fal", "tod", "til", "tin", "hap", "mic", "fan", "pat",
"tac", "lab", "mog", "sim", "son", "pin", "lom", "ric", "tap", "fir", "has", "bos", "bat", "poc", "hac", "tid",
"hav", "sap", "lin", "dib", "hos", "dab", "bit", "bar", "rac", "par", "lod", "dos", "bor", "toc", "hil", "mac",
"tom", "dig", "fil", "fas", "mit", "hob", "har", "mig", "hin", "rad", "mas", "hal", "rag", "lag", "fad", "top",
"mop", "hab", "nil", "nos", "mil", "fop", "fam", "dat", "nol", "din", "hat", "nac", "ris", "fot", "rib", "hoc",
"nim", "lar", "fit", "wal", "rap", "sar", "nal", "mos", "lan", "don", "dan", "lad", "dov", "riv", "bac", "pol",
"lap", "tal", "pit", "nam", "bon", "ros", "ton", "fod", "pon", "sov", "noc", "sor", "lav", "mat", "mip", "fip"]
const suffixes = [
"zod", "nec", "bud", "wes", "sev", "per", "sut", "let", "ful", "pen", "syt", "dur", "wep", "ser", "wyl", "sun",
"ryp", "syx", "dyr", "nup", "heb", "peg", "lup", "dep", "dys", "put", "lug", "hec", "ryt", "tyv", "syd", "nex",
"lun", "mep", "lut", "sep", "pes", "del", "sul", "ped", "tem", "led", "tul", "met", "wen", "byn", "hex", "feb",
"pyl", "dul", "het", "mev", "rut", "tyl", "wyd", "tep", "bes", "dex", "sef", "wyc", "bur", "der", "nep", "pur",
"rys", "reb", "den", "nut", "sub", "pet", "rul", "syn", "reg", "tyd", "sup", "sem", "wyn", "rec", "meg", "net",
"sec", "mul", "nym", "tev", "web", "sum", "mut", "nyx", "rex", "teb", "fus", "hep", "ben", "mus", "wyx", "sym",
"sel", "ruc", "dec", "wex", "syr", "wet", "dyl", "myn", "mes", "det", "bet", "bel", "tux", "tug", "myr", "pel",
"syp", "ter", "meb", "set", "dut", "deg", "tex", "sur", "fel", "tud", "nux", "rux", "ren", "wyt", "nub", "med",
"lyt", "dus", "neb", "rum", "tyn", "seg", "lyx", "pun", "res", "red", "fun", "rev", "ref", "mec", "ted", "rus",
"bex", "leb", "dux", "ryn", "num", "pyx", "ryg", "ryx", "fep", "tyr", "tus", "tyc", "leg", "nem", "fer", "mer",
"ten", "lus", "nus", "syl", "tec", "mex", "pub", "rym", "tuc", "fyl", "lep", "deb", "ber", "mug", "hut", "tun",
"byl", "sud", "pem", "dev", "lur", "def", "bus", "bep", "run", "mel", "pex", "dyt", "byt", "typ", "lev", "myl",
"wed", "duc", "fur", "fex", "nul", "luc", "len", "ner", "lex", "rup", "ned", "lec", "ryd", "lyd", "fen", "wel",
"nyd", "hus", "rel", "rud", "nes", "hes", "fet", "des", "ret", "dun", "ler", "nyr", "seb", "hul", "ryl", "lud",
"rem", "lys", "fyn", "wer", "ryc", "sug", "nys", "nyl", "lyn", "dyn", "dem", "lux", "fed", "sed", "bec", "mun",
"lyr", "tes", "mud", "nyt", "byr", "sen", "weg", "fyr", "mur", "tel", "rep", "teg", "pec", "nel", "nev", "fes"]
const entropy = getEntropy()
const len = Math.ceil(entropy / 16) // 16 bits per "word"
let pass = '~'
for (let i = len; i > 0; i--) {
pass += prefixes[secRand(256, pseudoProps.entropyCheck.checked)] + suffixes[secRand(256, pseudoProps.entropyCheck.checked)]
if (i > 1) {
pass += '-'
}
}
return [pass, len * 16]
}
================================================
FILE: js/randogram.js
================================================
"use strict"
const randogramProps = {
"lifetimeBits": parseInt(localStorage.lifetimeBits, 10) || 0,
"length": 400,
"entropy": [],
"bits": [],
"neumann": [],
"ctx": document.getElementById('randogram').getContext('2d'),
"officerRank": document.getElementById('officerRank'),
"rankPips": document.getElementById('rankPips'),
"nextRank": document.getElementById('nextRank'),
"remainingRankBits": document.getElementById('remainingRankBits'),
"entropyResult1": document.getElementById('entropyResult1'),
"entropyResult2": document.getElementById('entropyResult2'),
}
/**
* Awards a Star Trek officer rank based on the number of bits they've
* accumulated over the life of the game.
* @param {Number} bits - The amount of unbiased bits collected.
*/
function awardOfficerRank (bits) {
// Thank you https://feathericons.com/
const openPip = `
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#333333" stroke="#d1a52c" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-circle">
<circle cx="12" cy="12" r="10"></circle>
</svg>
`
const closedPip = `
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#d1a52c" stroke="#d1a52c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-circle">
<circle cx="12" cy="12" r="10"></circle>
</svg>
`
/*
For each key (rank), the value is the pip assignment as an array of 2 elements.:
[0, .] are non-boxed pips (Ensign through Fleet Captain)
[1, .] are boxed pips (Commodore through Fleet Admiral)
The pips themselves have two values:
"O" is an open pip (as seen on Chief Petty Officer, Lieutenant Junior Grade, & Lieutenant Commander)
"C" is a closed pip (as seen on Ensign through Fleet Admiral)
There is probably a better way to do this.
*/
const rankPips = {
'Cadet': '[0, ""]',
'Chief Petty Officer': '[0, "O"]',
'Ensign': '[0, "C"]',
'Lieutenant Junior Grade': '[0, "OC"]',
'Lieutenant': '[0, "CC"]',
'Lieutenant Commander': '[0, "OCC"]',
'Commander': '[0, "CCC"]',
'Captain': '[0, "CCCC"]',
'Fleet Captain': '[0, "CCCCC"]',
'Commodore': '[1, "C"]',
'Rear Admiral': '[1, "CC"]',
'Vice Admiral': '[1, "CCC"]',
'Admiral': '[1, "CCCC"]',
'Fleet Admiral': '[1, "CCCCC"]'
}
/*
Rank is awarded exponentially based on the number of bits generated as
2**bits >> 4.
For example:
- Until you generate less than 64 bits, you are a cadet in the academy.
- When you have generated 1,280 bits, your awarded rank would be
"Commander".
- When you have generated 128 samples, you would be promoted to "Captain".
- To reach 'Fleet Admiral', you need to generate 16,384 samples (262,144
bits).
Rank is only awarded, never revoked. That is, unless you clear your
localStorage.
*/
const rankOrder = [
'Cadet', // 0 <= bits < 64
'Chief Petty Officer', // 64 <= bits < 128
'Ensign', // 128 <= bits < 256
'Lieutenant Junior Grade', // 256 <= bits < 512
'Lieutenant', // 512 <= bits < 1,024
'Lieutenant Commander', // 1,024 <= bits < 2,048
'Commander', // 2,048 <= bits < 4,096
'Captain', // 4,096 <= bits < 8,192
'Fleet Captain', // 8,192 <= bits < 16,384
'Commodore', // 16,384 <= bits < 32,768
'Rear Admiral', // 32,768 <= bits < 65,536
'Vice Admiral', // 65,536 <= bits < 131,072
'Admiral', // 131,072 <= bits < 262,144
'Fleet Admiral' // 262,144 <= bits
]
localStorage.lifetimeBits = bits
let rank
if (bits < 64) {
rank = rankOrder[0]
} else {
rank = rankOrder[Math.floor(Math.log2(bits >> 4)) - 1]
}
let nextRank = rankOrder[rankOrder.indexOf(rank) + 1]
localStorage.rank = rank
randogramProps.officerRank.innerText = rank
randogramProps.nextRank.innerText = nextRank
randogramProps.remainingRankBits.innerText = (2 ** (rankOrder.indexOf(nextRank) + 1) << 4) - localStorage.lifetimeBits
// openPip, closedPip
let pipString = ''
let pips = JSON.parse(rankPips[rank])
pipString = pips[1].replace(/O/, openPip)
pipString = pipString.replace(/C/g, closedPip)
randogramProps.rankPips.innerHTML = pipString
if (pips[0] === 1) {
randogramProps.rankPips.style.background = '#333333'
randogramProps.rankPips.style.border = '3px solid #d1a52c'
randogramProps.rankPips.style.borderRadius = '5px'
randogramProps.rankPips.style.padding = '11px 2px 2px 2px'
}
}
/**
* Concatenate multiple arrays into one.
* @param {Array} resultConstructor - A JavaScript typed Array to store tho concatenated arrays.
* @param {...any} arrays - A iterable list of data to concatenate.
* @return {Array} - A typed array.
*/
function concatenate(resultConstructor, ...arrays) {
// https://exploringjs.com/impatient-js/ch_typed-arrays.html#concatenating-typed-arrays
let totalLength = 0
for (const arr of arrays) {
totalLength += arr.length
}
const result = new resultConstructor(totalLength)
let offset = 0
for (const arr of arrays) {
result.set(arr, offset)
offset += arr.length
}
return result
}
/** Generate cryptographically secure random numbers for one randogram. */
function randogram () {
return crypto.getRandomValues(new Uint8Array(40000))
}
/** Concatenate four cryptographically secure randograms to fill the canvas. */
function genPixels () {
return concatenate(Uint8Array, randogram(), randogram(), randogram(), randogram())
}
/** John von Neumann randomness extraction method. */
function extractRandomness() {
if (randogramProps.neumann.length === 2) {
if (randogramProps.neumann[0] !== randogramProps.neumann[1]) {
randogramProps.bits.push(randogramProps.neumann[0])
randogramProps.lifetimeBits++
if (randogramProps.bits.length === 16) {
randogramProps.entropy.push(parseInt(randogramProps.bits.join(''), 2))
randogramProps.bits = []
}
}
randogramProps.neumann = []
}
}
/** Draw the actual randogram on the canvas and animate it. */
function drawRandogram () {
const imgData = randogramProps.ctx.createImageData(randogramProps.length, randogramProps.length)
const pixels = genPixels()
if (localStorage.hasOwnProperty('entropy')) {
randogramProps.entropy = JSON.parse(localStorage.entropy)
}
for (let i = 0; i < imgData.data.length; i += 4) {
if (pixels[i >> 2] < 128) {
imgData.data[i] = 255 // red
imgData.data[i + 1] = 255 // green
imgData.data[i + 2] = 255 // blue
}
imgData.data[i + 3] = 255 // alpha
}
updateEntropyCounts() // set count initially
awardOfficerRank(randogramProps.lifetimeBits)
randogramProps.ctx.putImageData(imgData, 0, 0)
requestAnimationFrame(drawRandogram)
document.getElementById('randogram').onpointermove = function (e) {
const x = Math.floor(e.offsetX)
const y = Math.floor(e.offsetY)
if (0 <= x && x < randogramProps.length && 0 <= y && y < randogramProps.length) {
const index = randogramProps.length * y + x
randogramProps.neumann.push(pixels[index] & 1)
extractRandomness()
}
localStorage.entropy = JSON.stringify(randogramProps.entropy)
updateEntropyCounts() // update counts on mouse movement
awardOfficerRank(randogramProps.lifetimeBits)
}
}
/** Update the statistics on the page for the user to see their randomness
* progress. */
function updateEntropyCounts () {
let items = 0
if (localStorage.hasOwnProperty('entropy')) {
items = JSON.parse(localStorage.entropy).length
}
randogramProps.entropyResult1.innerText = items << 4
randogramProps.entropyResult2.innerText = items
}
drawRandogram()
================================================
FILE: js/random.js
================================================
"use strict"
const randomProps = {
"passId": document.getElementById('random-pass'),
"passLength": document.getElementById('random-length'),
"passEntropy": document.getElementById('random-entropy'),
"setSize": document.getElementById('random-set-size'),
"passCheck": document.getElementById('random-check'),
"entropyCheck": document.getElementById('random-entropy-check'),
}
/** Generate a random meaningless password string. */
function generateRandom() {
let s = ''
let check = ''
let displayCheck = false
const entropy = getEntropy()
const option = document.getElementById('random-options').value
randomProps.passCheck.innerText = ''
randomProps.passId.classList.remove('whitespace')
randomProps.passId.removeAttribute('style') // from emoji
// ASCII optgroup
if (option === 'Base94') {
for (let i = 0; i < 94; i++) {
s += String.fromCharCode(33 + i)
}
} else if (option === 'Base85') {
s = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&()*+-;<=>?@^_`{|}~'
} else if (option === 'Base64') {
s = '`!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'
} else if (option === 'Base62') {
s = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
} else if (option === 'Base58') {
s = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
} else if (option === 'Base52') {
s = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
} else if (option === 'Base45') {
s = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_$%*+-./:'
} else if (option === 'Base36') {
s = '0123456789abcdefghijklmnopqrstuvwxyz'
} else if (option === 'Base32') {
// Crockford's base32
s = '0123456789abcdefghjkmnpqrstvwxyz'
} else if (option === 'Base26') {
s = 'abcdefghijklmnopqrstuvwxyz'
} else if (option === 'Base16') {
s = '0123456789abcdef'
} else if (option === 'Base10') {
s = '0123456789'
} else if (option === 'Base8') {
s = '01234567'
} else if (option === 'Base4') {
s = '0123'
} else if (option === 'Base2') {
s = '01'
}
// Unicode optgroup
else if (option === 'Emoji') {
return generateEmoji()
} else if (option === 'ISO 8859-1') {
// Base188
unicodeWarn()
for (let i = 0; i < 94; i++) {
// Standard ASCII
s += String.fromCharCode(33 + i)
}
for (let i = 0; i < 95; i++) {
s += String.fromCharCode(161 + i)
}
s = s.replace(String.fromCharCode(173), '') // soft-hyphen isn't graphical
} else if (option === 'Latin Extended') {
// Base256
unicodeWarn()
s = 'ḀḁḂḃḄḅḆḇḈḉḊḋḌḍḎḏḐḑḒḓḔḕḖḗḘḙḚḛḜḝḞḟḠḡḢḣḤḥḦḧḨḩḪḫḬḭḮḯḰḱḲḳḴḵḶḷḸḹḺḻḼḽḾḿ'
s += 'ṀṁṂṃṄṅṆṇṈṉṊṋṌṍṎṏṐṑṒṓṔṕṖṗṘṙṚṛṜṝṞṟṠṡṢṣṤṥṦṧṨṩṪṫṬṭṮṯṰṱṲṳṴṵṶṷṸṹṺṻṼṽṾṿ'
s += 'ẀẁẂẃẄẅẆẇẈẉẊẋẌẍẎẏẐẑẒẓẔẕẖẗẘẙẚẛẜẝẞẟẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾế'
s += 'ỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹỺỻỼỽỾỿ'
} else if (option === 'Mac OS Roman') {
// Base220
unicodeWarn()
for (let i = 0; i < 94; i++) {
// Standard ASCII
s += String.fromCharCode(33 + i)
}
// Excludes Unicode U+F8FF in the Corporate Private Use Area for the Apple logo
s += 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæ'
s += 'ø¿¡¬√ƒ≈∆«»…ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ'
} else if (option === "Whitespace" ) {
// Must be inside CSS "break-spaces" to render tab and not collapse or trim spaces.
unicodeWarn()
s = [
/*
* Non-zero width, horizontal, non-graphical spaces/blanks.
*
* \u{00A0} is converted to \u{0020} on copy. This is a long-standing bug:
* - https://bugs.chromium.org/p/chromium/issues/detail?id=346096
* - https://bugzilla.mozilla.org/show_bug.cgi?id=359303
* - https://bugzilla.mozilla.org/show_bug.cgi?id=1769534
* \u{00AD} replaces \u{00A0} in the meantime to provide exactly 32 characetrs.
*
* "\u{115F}\u{1160}" produces tofu with the Noto Sans Mono font. Replaced with \u{2062}
* and \u{2064} to accompany \u{2063}.
*/
'\u{0009}', // Character tabulation
'\u{0020}', // Space
'\u{2000}', // En quad
'\u{2001}', // Em quad
'\u{2002}', // En space
'\u{2003}', // Em space
'\u{2004}', // Three-per-em space
'\u{2005}', // Four-per-em space
'\u{2006}', // Six-per-em space
'\u{2007}', // Figure space
'\u{2008}', // Punctuation space
'\u{2009}', // Thin space
'\u{200A}', // Hair space
'\u{2028}', // Line separator
'\u{2029}', // Paragraph separator
'\u{202F}', // Narrow no-break space
'\u{205F}', // Medium mathematical space
'\u{2800}', // Braille pattern blank
'\u{3000}', // Ideographic space
'\u{3164}', // Hangul filler
'\u{FFA0}', // Halfwidth hangul filler
// Zero width, non-control spaces/blanks.
'\u{00AD}', // Soft hyphen
'\u{034F}', // Combining grapheme joiner
'\u{180E}', // Mongolian vowel separator
'\u{200B}', // Zero width space
'\u{200C}', // Zero width non-joiner
'\u{200D}', // Zero width joiner
'\u{2060}', // Word joiner
'\u{2062}', // Invisible times
'\u{2063}', // Invisible separator
'\u{2064}', // Invisible plus
'\u{FEFF}', // Zero width non-breaking space
]
}
let len = Math.ceil(entropy / Math.log2(s.length))
let pass = generatePass(len, s, false, randomProps.entropyCheck.checked)
if (option === 'Base32') {
// Add Crockford's modulo 37 checksum
let res = 0n
const check = s + '*~$=u'
displayCheck = true
for (let i = 0; i < pass.length; i++) {
res += BigInt(s.indexOf(pass[i]) * 32 ** (pass.length - i - 1))
}
pass += check[res % 37n]
}
if (option === 'Whitespace') {
// Eeaster egg for typing "mork" on the keyboard
if (sessionStorage.getItem('mork')) {
len = 1
pass = '\u{1F9D1}\u{1F3FB}\u{200D}\u{1F680}' // astronaut: light skin tone
sessionStorage.removeItem('mork')
randomProps.passCheck.innerText = 'Na-Nu Na-Nu'
} else {
pass = "\u{2800}" + pass + "\u{2800}"
randomProps.passId.classList.add('whitespace')
}
}
randomProps.passLength.innerText = len + ' characters'
randomProps.passId.innerText = pass
randomProps.setSize.innerText = s.length.toLocaleString() + ' characters'
randomProps.passEntropy.innerText = Math.floor(len * Math.log2(s.length)) + ' bits'
if (displayCheck) {
randomProps.passCheck.innerText = 'Integrated checksum.'
}
}
/** Generate an emoji password. */
function generateEmoji() {
unicodeWarn()
const entropy = getEntropy()
const len = Math.ceil(entropy / Math.log2(randomEmoji.length))
const pass = generatePass(len, randomEmoji, false, randomProps.entropyCheck.checked)
randomProps.passLength.innerText = len + ' emoji'
randomProps.passId.style.fontFamily = 'Noto Color Emoji'
randomProps.passId.innerText = pass
randomProps.setSize.innerText = randomEmoji.length.toLocaleString() + ' emoji'
randomProps.passEntropy.innerText = Math.floor(len * Math.log2(randomEmoji.length)) + ' bits'
}
================================================
FILE: lists/alternateAF.js
================================================
"use strict"
const aaf = []
const alternateAF = []
aaf[1] = "abcdefghijklmnopqrstuvwxyzéêò"
aaf[2] = "aaabafagaialasaubabgblbmbnbobvbydedidrdsdudvdyebegeiekeleneoesetexgôhahkhyhêidinisjajykblalglylêmamlmmmvmynangnlnonunánèofomoposotouoëpapcpipyrarerurysasesosysêtetytéuiunuputvkwpysòf"
aaf[3] = "aalaanaapaaraasabmadjadvafdagsagtahiajvalgaltancapearearkartasbatgatvaubauxbadbakbalbanbarbasbedbekbelbesbidbiebisblybodbofbogbokbolbombonbosbotbouboëbrabrybuibukbulbusbyebylbytcumdaedagdakdaldamdandardasdatdeidekdendeodepderdesdiadiedigdikdipdisditdiédmvdofdogdokdoldomdondopdordosdotdoudradufduidunduodusdutduxdwsdyedykdyndítedeeedeeneereeteeuefaegaegoeieeikeiselfelkelsendeneengensenteonepeeraerdereerfergersertespesteteetsevaewefatfeefelfesfeëfinfisfopfutfynfytg'ngalgasgatgeegekgengesgifgilgisgloglygodgomgougrugulgungushadhaehakhalhamhaphefhegheihekhelhenheshethichikhiphochoehofhokholhomhophothouhoëhulhunhuphuthyghysibmiepierinkivmjagjakjamjanjasjeljenjigjiljobjokjoljoujukjuljuskabkafkamkankapkarkaskatkefkeikenkeukikkilkimkinkiskitkjvklakokkolkomkonkopkoskoukplkrukrykugkulkuskyfkyklaelaflaglaklamlaplaslatlegleileklellemleolesletleëlidligliplislitlobloflogloklolloslotloulugluilukluslxxlyelyflyklymlynlysmaemagmakmalmanmasmatmeemeimejmesmetmevmikminmismnrmoamofmogmokmolmommopmormosmotmoumudmufmusmylmynmytnagnarnatneeneknesnetnewnienignilnisnognoknomnonnopnosnounuknulnutnydnygnéeocpodeoeroesohmoktolmonsoogooiookoomoopooroosopeoreoudouepadpagpakpalpanpappaspelpenperpespetpikpilpitplapofpokpolpopporpospotpouproprypukpulputpyepylpynpypquaquequoradrakralramraprasratredreeregreirekremrenrepresreërgnribrifrigrilritrobrofrogrokrolrosrotroursarugruirukrumrusryerygrykrymrynrypryss'nsaesagsaksalsapsassatsedseesegselsensessetseësicsifsigsinsirsissitskiskuslusnysoesogsoksolsomsonsopsotsouspaspustestusufsugsulsussydsyesygsynsystaftaktaltamtaptasteetefteltemtenterteëtiktintiptobtoetogtoltontoptortottoutovtrutuftugtydtyeuieuiluitundupeureurnusuuuruwevaevagvakvalvanvasvatveevegvelvervesvetviavinvirvisvitvlavogvouvravryvsavulvyfvérwaswatwegwekwelwenweswiewilwiswouwydwyewykwylwynwys"
aaf[4] = "aandaardabbaabdyabteactaacvvaddoadelademafhêaflêafryafsêagieagteaktealanalbaalfaalgealiaallealmaalomalpealsoalteamenamokangsannoantianysapiearakariaarkearmeartsarumasiëasmaasofasseasteaswaasynatkvatolaulabaaibaalbaanbaarbaasbaatbababaiebalebalkbandbanebangbankbarebarkbarsbasebatebaälbedebeefbeekbeenbeerbeesbeetbelebelybelêbenebenyberebergberkbetabeulbeurbewebiedbiegbiepbierbiesbindbladblafblasblesblikblokblomblosbloublufblusblyeblykbodeboefboegboeiboekboelboerboetboksbomebondbonebonkbonsbontboogboomboonboorboosbootbordboreborgborsbosebotebotsboudboulboutbowebrakbrasbreibresbreëbrilbrokbrombronbrosbroubrugbrulbrûebuiebuigbuikbuisbuitbuksbulkbultbureburgburobuurbylebylêbynabysêbêrecoupcrmecruxdaaddaagdaaldaardadadadedaildaledalkdamedampdankdansdatadatodeegdeeldeendeerdeesdeindeledelfdelgdempdenedenkdepsdeptdermdesedeugdeurdeusdeutdeïsdhowdiasdiefdiendiepdierdiesdinedingdinkdisadivadodedododoekdoeldoemdoendoerdogedolfdolkdompdonsdooddoofdoogdooidooldoopdoordoosdoredorpdorsdosedowedraedrafdragdriedrifdrildromdropdrosdroëdrukdrupdryfduelduetduieduifduigduikduimduinduitdulddumpdunkdupedurfduurdykeedeledenedikeelteendeenheenseerseeueefaseffeegaseggeeggoegosegteeieneiereikeeinaeindeireeiseekkeelfeelfselimelkeelleelseelweemiremmeemoeendeengeenigenneenteeoneeonsepogeposerasergeergoergsernseroserreerteertserweesaueselespeesraesseesteetesetseevasewigexitfaalfaamfaasfacefaitfasefatafaunfautfauxfeesfeilfeitfelsfermfiatfidefierfiksfilmfinsfixeflapflesflorflouflusfoeifonefooifoonforaforsfortfotofoutfretfrisfritfrokfrotfugafuiffuikgaafgaangaapgaargaasgadegaelgalagalggalmganggansgapsgaregarsgategatsgawegeaggedugedygeelgeengeergeesgehugeilgeitgejageldgelygelêgenegerfgerygeskgesêgetygeurgeutgewygeykgeylgeysgeëbgeëggeërgidsgiekgiergietgipsgispgitsgladglasglesglimglipglitglosgodegodsgoedgolfgonsgooigoorgoragordgortgorêgotegoudgouegoëlgrafgraggramgrapgrasgrifgrilgrimgripgrofgromgrosgrotgrougrypgrysguitgulpgunsguregutsguurhaaghaaihaakhaalhaanhaarhaashaathaelhagehakehalehalfhalmhalohalshalthandhanehanghanshardhareharkharpharsharthasehawehebrhedeheelheenheerheesheetheieheilheksheldhelehelmhelphelshempheraherdherehertheteheugheulheuphfsthielhierhiethinkhitshobohoedhoefhoekhoesholehomohomphondhonshoofhooghoolhoonhoophoorhopehorehosehouehouthowehoërhuidhuighuikhuilhuishulphulshunshupshurkhuuribisideeidemideëidioiepeiereiersietsikeyikonindoineginhêinjainkainlêinryinsêinwyioneioonipsoirakiranirisironisisismeitemjaagjaarjadejaerjamsjarejazzjetijeugjeukjobajodejogajogijohojolejonajongjonkjoodjooljoosjorsjotajoëljuanjudajudojuigjuisjunojurajurejurkjutejutskaaikaakkaalkaapkaaskadekadikagekainkakekalfkalikalkkalmkampkanokanskantkapekarpkasekatskeelkeepkeerkeeskeiekeilkelekelkkelpkeltkenskepekepskerekerfkerkkermkernkerskesekeuekeurkeuskeëlkhankiekkielkiemkieskieukilokinakindkinkkitskiwikladklaeklagklakklamklapklaskleekleiklemklikklimklipklokklopklosklouklubklugknaeknakknalknapkneeknegknelknieknikknipknokknolknopknorknotknouknusknypkodekoeikoekkoelkoerkoeskolakolekolfkolkkomakomskookkoolkoopkoorkorekorfkorskortkoudkouekouskplnkraekragkrakkramkrapkraskratkrikkrilkripkromkropkroskrotkruikrukkrulkrygkryskrytkubakuifkuilkuipkuiskuitkungkunskurekurkkuurkuwekwabkwakkwalkwarkwaskwelkweskwikkwylkwynkwytkôsalaaflaaglaailaaklaanlaaslaatlaerlakslamalamplamélandlanelanglanklanslapalapslarelatelawalaweledeleedleefleekleenleerleesleeuleielekelenelenglenslereleseletsleukleunleusleweleërliaslidoliedlieflieglierliesligalimflintliralittlocoloefloeiloeploerloeslogelokolokslomplonelonglonklonslontloodlooflooglooiloomloonlooplooslootlordloteloweloënludoluidluikluimluisluitlunslvsalydelyerlykelynelywelêermaagmaaimaakmaalmaanmaarmaasmaatmaermagemakemalamalemalsmamamamsmanemankmansmaremarkmarsmarxmasematemedemeelmeenmeermeesmeetmeeumeidmeldmelkmengmensmenumeremergmerkmetameugmeulmidimiedmiermietmikamildmiltminimirtmitemitsmoabmoasmodemodimoedmoegmoermoesmoetmolmmondmooimoormootmoremorfmorgmorimorsmotemouemoutmuilmuismuitmuntmuremurgmusemuurmylemynemynsmytemêmemôrenaadnaafnaainaaknaamnaarnaasnaatnabynaelnajanamenarynasênatenawenaylnazineefneemneerneetnegeneigneo-neonnerfnersneteneukneulneusneutnewenie-niernietniksnimfnoagnodeno
gitextract_8cl0tsvt/ ├── .gitignore ├── COPYING.md ├── FEATURES.md ├── LICENSE.md ├── README.md ├── assets/ │ └── style.css ├── bookmarklets.html ├── entropy.html ├── index.html ├── js/ │ ├── alternate.js │ ├── cryptocurrency.js │ ├── diceware.js │ ├── eff.js │ ├── main.js │ ├── pseudowords.js │ ├── randogram.js │ └── random.js ├── lists/ │ ├── alternateAF.js │ ├── alternateBE.js │ ├── alternateColors.js │ ├── alternateDeseret.js │ ├── alternateElvish.js │ ├── alternateEyeware.js │ ├── alternateHR.js │ ├── alternateKlingon.js │ ├── alternateMN.js │ ├── alternateObscure.js │ ├── alternatePgp.js │ ├── alternatePokerware.js │ ├── alternateSR.js │ ├── alternateShavian.js │ ├── alternateSimpsons.js │ ├── alternateSkey.js │ ├── alternateTrump.js │ ├── alternateUK.js │ ├── alternateVAN.js │ ├── alternateWordle.js │ ├── alternateZxcvbn.js │ ├── bitcoinCNSimp.js │ ├── bitcoinCNTrad.js │ ├── bitcoinCZ.js │ ├── bitcoinEN.js │ ├── bitcoinES.js │ ├── bitcoinFR.js │ ├── bitcoinIT.js │ ├── bitcoinJP.js │ ├── bitcoinKR.js │ ├── bitcoinPT.js │ ├── dicewareBG.js │ ├── dicewareBeale.js │ ├── dicewareCA.js │ ├── dicewareCN.js │ ├── dicewareCZ.js │ ├── dicewareDA.js │ ├── dicewareDE.js │ ├── dicewareEL.js │ ├── dicewareEN.js │ ├── dicewareEO.js │ ├── dicewareES.js │ ├── dicewareET.js │ ├── dicewareEU.js │ ├── dicewareFI.js │ ├── dicewareFR.js │ ├── dicewareHU.js │ ├── dicewareIT.js │ ├── dicewareIW.js │ ├── dicewareJP.js │ ├── dicewareLA.js │ ├── dicewareMI.js │ ├── dicewareNL.js │ ├── dicewareNLP.js │ ├── dicewareNO.js │ ├── dicewarePL.js │ ├── dicewarePT.js │ ├── dicewareRO.js │ ├── dicewareRU.js │ ├── dicewareSK.js │ ├── dicewareSL.js │ ├── dicewareSV.js │ ├── dicewareTR.js │ ├── effDistant.js │ ├── effGameOfThrones.js │ ├── effHarryPotter.js │ ├── effLong.js │ ├── effShort.js │ ├── effStarTrek.js │ ├── effStarWars.js │ ├── extra/ │ │ ├── README.md │ │ ├── alternateDeseret_lowercase.js │ │ ├── alternate_colors_full.js │ │ └── alternate_trump_full.js │ ├── moneroCN.js │ ├── moneroDE.js │ ├── moneroEN.js │ ├── moneroEO.js │ ├── moneroES.js │ ├── moneroFR.js │ ├── moneroIT.js │ ├── moneroJBO.js │ ├── moneroJP.js │ ├── moneroNL.js │ ├── moneroPT.js │ ├── moneroRU.js │ ├── pseudoBigrams.js │ ├── pseudoDibels.js │ └── randomEmoji.js ├── manifest.json └── mightytiny.html
SYMBOL INDEX (54 symbols across 8 files)
FILE: js/alternate.js
function generateAlternate (line 15) | function generateAlternate(selection) {
function generateAcronym (line 167) | function generateAcronym(wordCount, wordList, useEntropy) {
function generateColors (line 208) | function generateColors() {
function generateSKey (line 258) | function generateSKey() {
function generateVAN (line 276) | function generateVAN() {
FILE: js/cryptocurrency.js
function generateBitcoin (line 16) | function generateBitcoin(selection) {
function generateMonero (line 109) | function generateMonero(selection) {
FILE: js/diceware.js
function generateNLP (line 17) | function generateNLP(wordList, useEntropy) {
function generateDiceware (line 55) | function generateDiceware(selection) {
FILE: js/eff.js
function generateEff (line 15) | function generateEff(selection) {
FILE: js/main.js
constant PAGECONTAINER (line 4) | const PAGECONTAINER = document.getElementsByTagName('body')[0]
constant PREFERSDARKTHEME (line 5) | const PREFERSDARKTHEME = window.matchMedia('(prefers-color-scheme: dark)')
constant THEMESWITCHER (line 6) | const THEMESWITCHER = document.getElementById('theme_switcher')
constant SITECOLORS (line 7) | const SITECOLORS = {
function unicodeWarn (line 19) | function unicodeWarn() {
function setDarkTheme (line 27) | function setDarkTheme() {
function setLightTheme (line 47) | function setLightTheme() {
function initTheme (line 59) | function initTheme() {
function toggleTheme (line 77) | function toggleTheme() {
function getEntropy (line 86) | function getEntropy() {
function getSourceList (line 95) | function getSourceList(source) {
function generatePassphrase (line 115) | function generatePassphrase(source) {
function toggleStats (line 139) | function toggleStats(source) {
function toggleEntropyVisibility (line 179) | function toggleEntropyVisibility() {
function secRand (line 202) | function secRand(count, useEntropy) {
function uniquesOnly (line 231) | function uniquesOnly(list) {
function generatePass (line 243) | function generatePass(len, set, spaces, useEntropy) {
function isTooDark (line 279) | function isTooDark(hex) {
function isTooLight (line 298) | function isTooLight(hex) {
function addEntropy (line 316) | function addEntropy(hex) {
function updateSlider (line 341) | function updateSlider(n) {
function setSecurity (line 383) | function setSecurity() {
function loadPasses (line 397) | function loadPasses() {
function mork (line 407) | function mork() {
FILE: js/pseudowords.js
function generatePseudowords (line 14) | function generatePseudowords() {
function generateApple (line 71) | function generateApple() {
function generateBabble (line 150) | function generateBabble() {
function generateDaefen (line 196) | function generateDaefen() {
function generateDibels (line 285) | function generateDibels() {
function generateMunemo (line 306) | function generateMunemo() {
function generateKoremutake (line 364) | function generateKoremutake() {
function generateLepron (line 420) | function generateLepron() {
function generateLetterblock (line 503) | function generateLetterblock() {
function generateProquints (line 666) | function generateProquints() {
function generateUrbit (line 698) | function generateUrbit() {
FILE: js/randogram.js
function awardOfficerRank (line 23) | function awardOfficerRank (bits) {
function concatenate (line 136) | function concatenate(resultConstructor, ...arrays) {
function randogram (line 156) | function randogram () {
function genPixels (line 161) | function genPixels () {
function extractRandomness (line 166) | function extractRandomness() {
function drawRandogram (line 183) | function drawRandogram () {
function updateEntropyCounts (line 226) | function updateEntropyCounts () {
FILE: js/random.js
function generateRandom (line 13) | function generateRandom() {
function generateEmoji (line 183) | function generateEmoji() {
Condensed preview — 108 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,965K chars).
[
{
"path": ".gitignore",
"chars": 10,
"preview": "*.swp\ntmp\n"
},
{
"path": "COPYING.md",
"chars": 386,
"preview": "**Copyrights of other files used in this project**:\n\n`/assets/twemoji.woff2` is a WOFF2 implementation of the [Mozilla t"
},
{
"path": "FEATURES.md",
"chars": 7379,
"preview": "# Features\nThis password generator project consists of three families of generators:\n\n1. Passphrases\n2. Pseudowords (mem"
},
{
"path": "LICENSE.md",
"chars": 34189,
"preview": "GNU Affero General Public License\n=================================\n\n_Version 3, 19 November 2007_\n_Copyright © 2007 Fre"
},
{
"path": "README.md",
"chars": 12362,
"preview": "# Web-based Password Generator\nThis is a simple web-based password generator which uses 6-different styles\nof passwords "
},
{
"path": "assets/style.css",
"chars": 7497,
"preview": "@font-face {\n font-family: \"Noto Color Emoji\";\n src: url(\"./NotoColorEmoji-Regular.woff2\") format(\"woff2\");\n}\n\n@font-f"
},
{
"path": "bookmarklets.html",
"chars": 22969,
"preview": "<!doctype html>\n<html lang='en'>\n <head>\n <link rel='shortcut icon' href='favicon.ico'>\n <link rel='stylesheet' h"
},
{
"path": "entropy.html",
"chars": 5230,
"preview": "<!DOCTYPE html>\n<html lang='en'>\n <head>\n <link rel='shortcut icon' href='favicon.ico'>\n <link rel='stylesheet' h"
},
{
"path": "index.html",
"chars": 22601,
"preview": "<!doctype html>\n<html lang='en'>\n <head>\n <link rel='manifest' href='manifest.json'>\n <link rel='shortcut icon' h"
},
{
"path": "js/alternate.js",
"chars": 11368,
"preview": "\"use strict\"\n\nconst altProps = {\n \"passId\": document.getElementById('alt-pass'),\n \"passLength\": document.getElementByI"
},
{
"path": "js/cryptocurrency.js",
"chars": 5986,
"preview": "\"use strict\"\n\nconst cryptoProps = {\n \"passId\": document.getElementById('crypto-pass'),\n \"passLength\": document.getElem"
},
{
"path": "js/diceware.js",
"chars": 4753,
"preview": "\"use strict\"\n\nconst dicewareProps = {\n \"passId\": document.getElementById('diceware-pass'),\n \"passLength\": document.get"
},
{
"path": "js/eff.js",
"chars": 1545,
"preview": "\"use strict\"\n\nconst effProps = {\n \"passId\": document.getElementById('eff-pass'),\n \"passLength\": document.getElementByI"
},
{
"path": "js/main.js",
"chars": 12931,
"preview": "//\"use strict\"\n\n// globals\nconst PAGECONTAINER = document.getElementsByTagName('body')[0]\nconst PREFERSDARKTHEME = windo"
},
{
"path": "js/pseudowords.js",
"chars": 27222,
"preview": "\"use strict\"\n\nconst pseudoProps = {\n \"passId\": document.getElementById('pseudo-pass'),\n \"passLength\": document.getElem"
},
{
"path": "js/randogram.js",
"chars": 8012,
"preview": "\"use strict\"\n\nconst randogramProps = {\n \"lifetimeBits\": parseInt(localStorage.lifetimeBits, 10) || 0,\n \"length\": 400,\n"
},
{
"path": "js/random.js",
"chars": 7156,
"preview": "\"use strict\"\n\nconst randomProps = {\n \"passId\": document.getElementById('random-pass'),\n \"passLength\": document.getElem"
},
{
"path": "lists/alternateAF.js",
"chars": 29746,
"preview": "\"use strict\"\n\nconst aaf = []\nconst alternateAF = []\n\naaf[1] = \"abcdefghijklmnopqrstuvwxyzéêò\"\naaf[2] = \"aaabafagaialasau"
},
{
"path": "lists/alternateBE.js",
"chars": 21743,
"preview": "\"use strict\"\n\nconst abe = []\nconst alternateBE = []\n\nabe[1] = \"абгжзйкмосуяіў\"\nabe[2] = \"абадажайасахбобыбэбівавывігагбг"
},
{
"path": "lists/alternateColors.js",
"chars": 13142,
"preview": "\"use strict\"\n\nconst acn = [] // name\nconst ach = [] // hex\nconst alternateColors = {}\n\nacn[2] = 'Ao'\nach[2] = '66B447'\na"
},
{
"path": "lists/alternateDeseret.js",
"chars": 48634,
"preview": "\"use strict\"\n\nconst utah = []\nconst alternateDeseret = []\n\nutah[2] = '𐐀𐐕𐐀𐐢𐐁𐐔𐐁𐐣𐐃𐐓𐐄𐐓𐐄𐐗𐐄𐐙𐐅𐐞𐐇𐐖𐐌𐐝𐐍𐐕𐐍𐐢𐐎𐐌𐐎𐐍𐐏𐐇𐐔𐐀𐐘𐐌𐐙𐐄𐐛𐐃𐐛𐐌𐐜𐐀𐐝𐐁𐐟𐐌𐐡𐐤"
},
{
"path": "lists/alternateElvish.js",
"chars": 37248,
"preview": "\"use strict\"\n\nconst ael = []\nconst alternateElvish = []\n\nael[1] = 'aáâeéiíoóôuúû'\nael[2] = 'abadaeahaiâlamanarârasaubabâ"
},
{
"path": "lists/alternateEyeware.js",
"chars": 51985,
"preview": "\"use strict\"\n\nconst eye = []\nconst alternateEyeware = []\n\neye[3] = 'achactaddageaghagoaidailaimairaleallandanyapeaptarca"
},
{
"path": "lists/alternateHR.js",
"chars": 48091,
"preview": "\"use strict\"\n\nconst ahr = []\nconst alternateHR = []\n\nahr[2] = 'ćećuHTasatbidadoehgahahihmihimizišjajejukalimamemimunanen"
},
{
"path": "lists/alternateKlingon.js",
"chars": 12342,
"preview": "\"use strict\"\n\nconst akl = []\nconst alternateKlingon = []\n\nakl[1] = '0123456789!#$%&()*+-:;=?@'\nakl[2] = \"`aboDaDIDoHeHuj"
},
{
"path": "lists/alternateMN.js",
"chars": 15328,
"preview": "\"use strict\"\n\nconst amn = []\nconst alternateMN = []\n\namn[1] = 'лч'\namn[2] = 'БДГфГцДКДиЗеЛаЛиМТМбНДОмПХПоСИУБХКЧДШУЭШаа"
},
{
"path": "lists/alternateObscure.js",
"chars": 165264,
"preview": "\"use strict\"\n\nconst aob = []\nconst alternateObscure = []\n\n// Sourced from:\n// - https://phrontistery.info/clw.html\n// - "
},
{
"path": "lists/alternatePgp.js",
"chars": 4206,
"preview": "\"use strict\"\n\nconst apg = []\nconst alternatePgp = []\n\napg[4] = 'acmeammokiwiorcaOhiosoloZulu'\napg[5] = 'adultaheadAlgola"
},
{
"path": "lists/alternatePokerware.js",
"chars": 26767,
"preview": "\"use strict\"\n\nconst apw = []\nconst alternatePokerware = []\n\napw[3] = 'aceactaddadsageagoaidaimairaleallampandantanyapeap"
},
{
"path": "lists/alternateSR.js",
"chars": 45005,
"preview": "\"use strict\"\n\nconst asr = []\nconst alternateSR = []\n\nasr[2] = 'БеБоШоадарасатбабививогагодадедидоекелеперетзаизиминкакол"
},
{
"path": "lists/alternateShavian.js",
"chars": 47335,
"preview": "\"use strict\"\n\nconst shaw = []\nconst alternateShavian = []\n\nshaw[2] = '𐑐𐑼𐑓𐑴𐑔𐑪𐑕𐑱𐑖𐑹𐑖𐑺𐑗𐑺𐑘𐑨𐑛𐑩𐑜𐑹𐑞𐑰𐑤𐑺𐑧𐑡𐑪𐑑𐑮𐑺𐑯𐑰𐑰𐑗𐑰𐑤𐑱𐑛𐑱𐑥𐑴𐑑𐑴𐑒𐑴𐑓𐑵𐑟𐑸𐑑"
},
{
"path": "lists/alternateSimpsons.js",
"chars": 30346,
"preview": "\"use strict\"\n\nconst asi = []\nconst alternateSimpsons = []\n\nasi[1] = 'ai'\nasi[2] = 'adahalamanasatawaybabebycddadedodrede"
},
{
"path": "lists/alternateSkey.js",
"chars": 7804,
"preview": "\"use strict\"\n\nconst ask = []\nconst alternateSkey = []\n\nask[1] = 'AIO'\nask[2] = 'ADAMANASATAXBEBYDOEDEMGOHAHEHIHOIFIOIQIS"
},
{
"path": "lists/alternateTrump.js",
"chars": 49793,
"preview": "\"use strict\"\n\nconst atr = []\nconst alternateTrump = []\n\natr[1] = '$#0123456789abBcCdDeEfgGhiJklLmnNoOpQrRStuUVwyZ'\natr[2"
},
{
"path": "lists/alternateUK.js",
"chars": 26530,
"preview": "\"use strict\"\n\nconst auk = []\nconst alternateUK = []\n\nauk[2] = \"ІєІїЕКагажазайанарасатахбабибовавивоврвтгагегсгцгідедидмд"
},
{
"path": "lists/alternateVAN.js",
"chars": 6751,
"preview": "\"use strict\"\n\nconst verbs = []\nconst adjectives = []\nconst nouns = []\nconst alternateVAN = [[],[],[]]\n\nverbs[3]='AteDugF"
},
{
"path": "lists/alternateWordle.js",
"chars": 29211,
"preview": "\"use strict\"\n\nconst awd = []\nconst alternateWordle = []\n\n// https://github.com/cwackerfuss/react-wordle/ + 33 words from"
},
{
"path": "lists/alternateZxcvbn.js",
"chars": 212326,
"preview": "\"use strict\"\n\nconst azx = []\nconst alternateZxcvbn = []\n\nazx[4]=\"0001000704201000100110021003100410051007100810091011101"
},
{
"path": "lists/bitcoinCNSimp.js",
"chars": 8228,
"preview": "\"use strict\"\n\nconst bitcoinCNSimp=['的','一','是','在','不','了','有','和','人','这','中','大','为','上','个','国','我','以','要','他','时','"
},
{
"path": "lists/bitcoinCNTrad.js",
"chars": 8228,
"preview": "\"use strict\"\n\nconst bitcoinCNTrad=['的','一','是','在','不','了','有','和','人','這','中','大','為','上','個','國','我','以','要','他','時','"
},
{
"path": "lists/bitcoinCZ.js",
"chars": 19073,
"preview": "\"use strict\"\n\nconst bitcoinCZ=['abdikace','abeceda','adresa','agrese','akce','aktovka','alej','alkohol','amputace','anan"
},
{
"path": "lists/bitcoinEN.js",
"chars": 17244,
"preview": "\"use strict\"\n\nconst bitcoinEN=[\"abandon\",\"ability\",\"able\",\"about\",\"above\",\"absent\",\"absorb\",\"abstract\",\"absurd\",\"abuse\","
},
{
"path": "lists/bitcoinES.js",
"chars": 17787,
"preview": "\"use strict\"\n\nconst bitcoinES=['ábaco','abdomen','abeja','abierto','abogado','abono','aborto','abrazo','abrir','abuelo'"
},
{
"path": "lists/bitcoinFR.js",
"chars": 20517,
"preview": "\"use strict\"\n\nconst bitcoinFR=['abaisser','abandon','abdiquer','abeille','abolir','aborder','aboutir','aboyer','abrasif'"
},
{
"path": "lists/bitcoinIT.js",
"chars": 20161,
"preview": "\"use strict\"\n\nconst bitcoinIT=['abaco','abbaglio','abbinato','abete','abisso','abolire','abrasivo','abrogato','accadere'"
},
{
"path": "lists/bitcoinJP.js",
"chars": 14301,
"preview": "\"use strict\"\n\nconst bitcoinJP=['あいこくしん','あいさつ','あいだ','あおぞら','あかちゃん','あきる','あけがた','あける','あこがれる','あさい','あさひ','あしあと','あ"
},
{
"path": "lists/bitcoinKR.js",
"chars": 18104,
"preview": "\"use strict\"\n\nconst bitcoinKR=['가격','가끔','가난','가능','가득','가르침','가뭄','가방','가상','가슴','가운ᄃ"
},
{
"path": "lists/bitcoinPT.js",
"chars": 19799,
"preview": "\"use strict\"\n\nconst bitcoinPT=['abacate','abaixo','abalar','abater','abduzir','abelha','aberto','abismo','abotoar','abra"
},
{
"path": "lists/dicewareBG.js",
"chars": 33922,
"preview": "\"use strict\"\n\nconst dbg = []\nconst dicewareBG = []\n\ndbg[1] = '!#$%&()*+-0123456789:;=?@'\ndbg[2] = '!!##$$%%()**++--10111"
},
{
"path": "lists/dicewareBeale.js",
"chars": 33178,
"preview": "\"use strict\"\n\nconst den2 = []\nconst dicewareBeale = []\n\nden2[1] = 'abcdefghijklmnopqrstuvwxyz!#$%&()*+-0123456789:;=?@'\n"
},
{
"path": "lists/dicewareCA.js",
"chars": 51307,
"preview": "\"use strict\"\n\nconst dca = []\nconst dicewareCA = []\n\ndca[1] = 'fjquw'\ndca[2] = '1r2n3r4t5è6è7è8è9èçoduéshihlhmhoióipjajok"
},
{
"path": "lists/dicewareCN.js",
"chars": 16647,
"preview": "\"use strict\"\n\nconst dcn = []\nconst dicewareCN = []\n\ndcn[1] = '中光冲创双嗯娘成揣摔穷窘装转'\ndcn[2] = '一二一些一侧一共一再一准一切一口一同一头一套一如一定一带一应一律"
},
{
"path": "lists/dicewareCZ.js",
"chars": 37115,
"preview": "\"use strict\"\n\nconst dcz = []\nconst dicewareCZ = []\n\ndcz[1] = '!\"#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndcz["
},
{
"path": "lists/dicewareDA.js",
"chars": 33843,
"preview": "\"use strict\"\n\nconst dda = []\nconst dicewareDA = []\n\ndda[1] = '!#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndda[2"
},
{
"path": "lists/dicewareDE.js",
"chars": 37993,
"preview": "\"use strict\"\n\nconst dde = []\nconst dicewareDE = []\n\ndde[1] = '!#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz\"'\ndde["
},
{
"path": "lists/dicewareEL.js",
"chars": 39289,
"preview": "\"use strict\"\n\nconst del = []\nconst dicewareEL = []\n\ndel[1] = '!#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndel[2"
},
{
"path": "lists/dicewareEN.js",
"chars": 34056,
"preview": "\"use strict\"\n\nconst den = []\nconst dicewareEN = []\n\nden[1] = '!#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\nden[2"
},
{
"path": "lists/dicewareEO.js",
"chars": 42800,
"preview": "\"use strict\"\n\nconst deo = []\nconst dicewareEO = []\n\ndeo[1] = '!#%&()*+-:;=?@$0123456789abcĉdefgĝhĥijĵklmnoprsŝtuŭvz'\ndeo"
},
{
"path": "lists/dicewareES.js",
"chars": 32562,
"preview": "\"use strict\"\n\nconst des = []\nconst dicewareES = []\n\ndes[1] = '!\"#%+-/<=>?^{|}$0123456789abcdeEfghIjklmnNopqrsStuvwWxyz'\n"
},
{
"path": "lists/dicewareET.js",
"chars": 37765,
"preview": "\"use strict\"\n\nconst det = []\nconst dicewareET = []\n\ndet[1] = 'bcdefghijklmnopqrstuvwxyz'\ndet[2] = '!!##%%&&()**++--::;;="
},
{
"path": "lists/dicewareEU.js",
"chars": 40894,
"preview": "\"use strict\"\n\nconst deu = []\nconst dicewareEU = []\n\ndeu[1] = '!#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndeu[2"
},
{
"path": "lists/dicewareFI.js",
"chars": 40079,
"preview": "\"use strict\"\n\nconst dfi = []\nconst dicewareFI = []\n\ndfi[1] = 'n'\ndfi[2] = 'abafahaoaycdcmdmedeiemeneteuevflfmfthehshzipj"
},
{
"path": "lists/dicewareFR.js",
"chars": 53430,
"preview": "\"use strict\"\n\nconst dfr = []\nconst dicewareFR = []\n\ndfr[4] = \"abriacreafinagioagiraideaiguaileaimeaineairealoialpealunam"
},
{
"path": "lists/dicewareHU.js",
"chars": 33707,
"preview": "\"use strict\"\n\nconst dhu = []\nconst dicewareHU = []\n\ndhu[1] = '!#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndhu[2"
},
{
"path": "lists/dicewareIT.js",
"chars": 39365,
"preview": "\"use strict\"\n\nconst dit = []\nconst dicewareIT = []\n\ndit[1] = '!#%&()*+-:=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndit[2]"
},
{
"path": "lists/dicewareIW.js",
"chars": 29689,
"preview": "\"use strict\"\n\nconst diw = []\nconst dicewareIW = []\n\ndiw[2] = 'אבאגאדאהאואזאחאטאיאךאלאםאןאסאףאצאקאראשאתבאבבבגבדבהבובזבטבי"
},
{
"path": "lists/dicewareJP.js",
"chars": 38832,
"preview": "\"use strict\"\n\nconst djp = []\nconst dicewareJP = []\n\ndjp[1] = '0123456789abcdefghijklmnopqrstuvwxyz'\ndjp[2] = '1011121314"
},
{
"path": "lists/dicewareLA.js",
"chars": 47407,
"preview": "\"use strict\"\n\nconst dla = []\nconst dicewareLA = []\n\ndla[4] = 'abasabitaceracesacieacreactiaddiaddoadeoadesaedeaereaeviaf"
},
{
"path": "lists/dicewareMI.js",
"chars": 44871,
"preview": "\"use strict\"\n\nconst dmi = []\nconst dicewareMI = []\n\ndmi[2] = 'io'\ndmi[3] = 'ahaahiahoahuaiaaioakaakoakuamiamoamuanianoan"
},
{
"path": "lists/dicewareNL.js",
"chars": 39395,
"preview": "\"use strict\"\n\nconst dnl = []\nconst dicewareNL = []\n\ndnl[2] = 'adafahaialarasataubhbibvcdcvdcdedjdoebegeieleneresetexfage"
},
{
"path": "lists/dicewareNLP.js",
"chars": 51688,
"preview": "\"use strict\"\n\nconst dadj = []\nconst dnoun = []\nconst dicewareNLP = [[], []]\n\ndadj[2]='myno'\ndadj[3]='aftanybadbigdryfarf"
},
{
"path": "lists/dicewareNO.js",
"chars": 33121,
"preview": "\"use strict\"\n\nconst dno = []\nconst dicewareNO = []\n\ndno[1] = '!#%&()*+-:=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndno[2]"
},
{
"path": "lists/dicewarePL.js",
"chars": 37757,
"preview": "\"use strict\"\n\nconst dpl = []\nconst dicewarePL = []\n\ndpl[1] = '!#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndpl[2"
},
{
"path": "lists/dicewarePT.js",
"chars": 38538,
"preview": "\"use strict\"\n\nconst dpt = []\nconst dicewarePT = []\n\ndpt[1] = '!\"#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndpt["
},
{
"path": "lists/dicewareRO.js",
"chars": 39307,
"preview": "\"use strict\"\n\nconst dro = []\nconst dicewareRO = []\n\ndro[1] = '!#%&()*+-:;=?@$0123456789'\ndro[2] = '!!##%%&&()**++--==??$"
},
{
"path": "lists/dicewareRU.js",
"chars": 38330,
"preview": "\"use strict\"\n\nconst dru = []\nconst dicewareRU = []\n\ndru[3] = 'агаагуаилаиракракталиальасьатуаулаутбазбайбакбалбарбасбахб"
},
{
"path": "lists/dicewareSK.js",
"chars": 50105,
"preview": "\"use strict\"\n\nconst dsk = []\nconst dicewareSK = []\n\ndsk[1] = 'aAábBcCčdDeEfFgGhHiIjJkKlLmMnNoOópPrRsStTuUvVWxXyYzZ'\ndsk["
},
{
"path": "lists/dicewareSL.js",
"chars": 38154,
"preview": "\"use strict\"\n\nconst dsl = []\nconst dicewareSL = []\n\ndsl[1] = '!\"#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndsl["
},
{
"path": "lists/dicewareSV.js",
"chars": 34064,
"preview": "\"use strict\"\n\nconst dsv = []\nconst dicewareSV = []\n\ndsv[1] = '!#%&()*+-:;=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndsv[2"
},
{
"path": "lists/dicewareTR.js",
"chars": 37776,
"preview": "\"use strict\"\n\nconst dtr = []\nconst dicewareTR = []\n\ndtr[1] = '!\"#%&()*+-:=?@$0123456789abcdefghijklmnopqrstuvwxyz'\ndtr[2"
},
{
"path": "lists/effDistant.js",
"chars": 9764,
"preview": "\"use strict\"\n\nconst edi = []\nconst effDistant = []\n\nedi[3] = 'cupelkfoxgemoatpry'\nedi[4] = 'acidajaralsoatombodycageclay"
},
{
"path": "lists/effGameOfThrones.js",
"chars": 22786,
"preview": "\"use strict\"\n\nconst egt = []\nconst effGameOfThrones = []\n\negt[2] = 'anasatbebydogohahiinofonortoup'\negt[3] = 'actaddagea"
},
{
"path": "lists/effHarryPotter.js",
"chars": 22577,
"preview": "\"use strict\"\n\nconst ehp = []\nconst effHarryPotter = []\n\nehp[2] = 'ahamanatbebydoemengohahehiifinisitmemrmynoofohonorsoto"
},
{
"path": "lists/effLong.js",
"chars": 54631,
"preview": "\"use strict\"\n\nconst elo = []\nconst effLong = []\n\nelo[3] = 'aimartbokcodcutdabdaddigdryduhduoeelelfelkelmemufaxfitfoefogf"
},
{
"path": "lists/effShort.js",
"chars": 6100,
"preview": "\"use strict\"\n\nconst esh = []\nconst effShort = []\n\nesh[3] = 'aimartbokbudcodcotcubcutdabdaddigdotdrydugduoeelelfelkelmemu"
},
{
"path": "lists/effStarTrek.js",
"chars": 23337,
"preview": "\"use strict\"\n\nconst est = []\nconst effStarTrek = []\n\nest[2] = 'asbebygoinisitofonorto'\nest[3] = 'actaddaftageagoaidairal"
},
{
"path": "lists/effStarWars.js",
"chars": 22269,
"preview": "\"use strict\"\n\nconst esw = []\nconst effStarWars = []\n\nesw[1] = 'iv'\nesw[2] = 'anasatbebydogohahiiiinisitivixmenoofonortou"
},
{
"path": "lists/extra/README.md",
"chars": 871,
"preview": "# Extra Wordlists\nThis is a list of extra word lists for the project. The are not included in the\nHTML source, so they a"
},
{
"path": "lists/extra/alternateDeseret_lowercase.js",
"chars": 48620,
"preview": "const utah = []\nconst alternateDeseret = []\n\nutah[2] = '𐐨𐐽𐐨𐑊𐐩𐐼𐐩𐑋𐐫𐐻𐐬𐐻𐐬𐐿𐐬𐑁𐐭𐑆𐐯𐐾𐐴𐑅𐐵𐐽𐐵𐑊𐐶𐐴𐐶𐐵𐐷𐐯𐐼𐐨𐑀𐐴𐑁𐐬𐑃𐐫𐑃𐐴𐑄𐐨𐑅𐐩𐑇𐐴𐑉𐑌𐑊𐐯𐑌𐐨𐑌𐐴'\nutah[3"
},
{
"path": "lists/extra/alternate_colors_full.js",
"chars": 51678,
"preview": "var alternate_colors={\"Abbey\":\"4C4F56\",\"AbsoluteZero\":\"0048BA\",\"Acadia\":\"1B1404\",\"Acajou\":\"4C2F27\",\"Acapulco\":\"7CB0A1\",\""
},
{
"path": "lists/extra/alternate_trump_full.js",
"chars": 113388,
"preview": "\"$\",\n\"#\",\n\"0\",\n\"1\",\n\"2\",\n\"3\",\n\"4\",\n\"5\",\n\"6\",\n\"7\",\n\"8\",\n\"9\",\n\"a\",\n\"b\",\n\"B\",\n\"c\",\n\"C\",\n\"d\",\n\"D\",\n\"e\",\n\"E\",\n\"f\",\n\"g\",\n\"G\",\n"
},
{
"path": "lists/moneroCN.js",
"chars": 1817,
"preview": "\"use strict\"\n\nconst mcn = []\nconst moneroCN = []\n\nmcn[1] = '的一是在不了有和人这中大为上个国我以要他时来用们生到作地于出就分对成会可主发年动同工也能下过子说产种面而方后多定行学法所"
},
{
"path": "lists/moneroDE.js",
"chars": 10789,
"preview": "\"use strict\"\n\nconst mde = []\nconst moneroDE = []\n\nmde[4] = 'AffeAloeAmokAnisBachBartBassBaumBeilBettBlutBojeBootBuchChor"
},
{
"path": "lists/moneroEN.js",
"chars": 10132,
"preview": "\"use strict\"\n\nconst men = []\nconst moneroEN = []\n\nmen[4] = 'acesafarajarakinalsoammoapexarmyatomauntaxesaxisaxlebabybays"
},
{
"path": "lists/moneroEO.js",
"chars": 10765,
"preview": "\"use strict\"\n\nconst meo = []\nconst moneroEO = []\n\nmeo[4] = 'adzoagloainaajziakeoaknoaleoalgoaltaarboarkoarmibakibanibaro"
},
{
"path": "lists/moneroES.js",
"chars": 9251,
"preview": "\"use strict\"\n\nconst mes = []\nconst moneroES = []\n\nmes[3] = 'añoasaaveboacaldardíadondosdúoecoejefaxfeofingengolhaziraluz"
},
{
"path": "lists/moneroFR.js",
"chars": 9538,
"preview": "\"use strict\"\n\nconst mfr = []\nconst moneroFR = []\n\nmfr[4] = 'aboiabriacteafinagiraileaiseamiearmeaubeavalavecaveuavisazur"
},
{
"path": "lists/moneroIT.js",
"chars": 11388,
"preview": "\"use strict\"\n\nconst mit = []\nconst moneroIT = []\n\nmit[4] = 'agioalboalcealpiancaannoarcoariaarmaarteastaattoaulaautobene"
},
{
"path": "lists/moneroJBO.js",
"chars": 8629,
"preview": "\"use strict\"\n\nconst mjbo = []\nconst moneroJBO = []\n\nmjbo[5] = \"backibacrubadnabadribajrabakfubaknibakribaktubaljibalniba"
},
{
"path": "lists/moneroJP.js",
"chars": 6174,
"preview": "\"use strict\"\n\nconst mjp = []\nconst moneroJP = []\n\nmjp[3] = 'あいだあきるあけるあさいあさひあずきあそぶあたるあついあてなあひるあぶらあぶるあまいあまどあまりあゆむあらしあんいあんこ"
},
{
"path": "lists/moneroNL.js",
"chars": 11478,
"preview": "\"use strict\"\n\nconst mnl = []\nconst moneroNL = []\n\nmnl[4] = 'accuakzoamaiamokanyaasmlaurabeksbestbintbladbleubockboefboei"
},
{
"path": "lists/moneroPT.js",
"chars": 11857,
"preview": "\"use strict\"\n\nconst mpt = []\nconst moneroPT = []\n\nmpt[4] = 'acneainoaipoanjoaptoaulabudaceuscimocubocujodeaodoardoerdomo"
},
{
"path": "lists/moneroRU.js",
"chars": 9802,
"preview": "\"use strict\"\n\nconst mru = []\nconst moneroRU = []\n\nmru[4] = 'агатазотаисталыйарияаркаатомаурабазабанкбаянблокбунтбусыбыль"
},
{
"path": "lists/pseudoBigrams.js",
"chars": 10027,
"preview": "\"use strict\"\n\n// https://gist.github.com/lydell/c439049abac2c9226e53\nconst bigrams={'th':100272945963,'he':86697336727,'"
},
{
"path": "lists/pseudoDibels.js",
"chars": 13987,
"preview": "\"use strict\"\n\nconst dibels = []\nconst pseudoDibels = []\n\ndibels[2] = \"abacadafagajakalapavazebecefegekelemenepesetevibic"
},
{
"path": "lists/randomEmoji.js",
"chars": 23095,
"preview": "\"use strict\"\n\nconst randomEmoji = [\n// group: Smileys & Emotion\n\"😀\",\"😃\",\"😄\",\"😁\",\"😆\",\"😅\",\"🤣\",\"😂\",\"🙂\",\"🙃\",\"🫠\",\"😉\",\"😊\",\"😇\","
},
{
"path": "manifest.json",
"chars": 2221,
"preview": "{\n \"name\": \"Passphrase and Password Generator\",\n \"short_name\": \"webpassgen\",\n \"start_url\": \"./index.html\",\n "
},
{
"path": "mightytiny.html",
"chars": 6499,
"preview": "<!doctype html>\n<!-- Originaly written by Aaron Toponce https://github.com/atoponce/nodepassgen -->\n<!-- Minimized, i.e."
}
]
About this extraction
This page contains the full source code of the atoponce/webpassgen GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 108 files (2.9 MB), approximately 770.8k tokens, and a symbol index with 54 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.