Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmexdev committed Jun 29, 2021
1 parent 661756a commit ec278ec
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 183,918 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Small password generator "utility" for Windows, Mac, & *possibly* Linux.

There might be some helpful information in the Wiki if we get around to making it.

## Disclaimer
## Note

The passwords generated in PPG would take more than 15 hundred million years (according to HSIMP).

Expand All @@ -16,7 +16,7 @@ Your passwords will never be sent over the internet.

First, uninstall PPG.

The uninstall `.exe` can be found in `C:\Program Files (x86)\PGG\unins000.exe`.
The uninstall `.exe` can be found here: `C:\Program Files (x86)\PGG\unins000.exe`.

Then download the newest version from the releases page.

Expand All @@ -30,6 +30,16 @@ Simply start the app. It automatically generates a password on startup. However,

Right-click the tray icon, then hover over `Password` a click `Generate new and copy`. That will generate a new password (cannot be seen until pasted) and copy it to clipboard. It will also send a notification.

# Building from source

There are a few files missing from the source code. If you are interested in building this app from the source code, please let me know and I'll give you the files.

- `dictionary.json`: a dictionary file formatted as JSON
- `words.txt`: a text file with 100,000+ words
- `style.css`: TailwindCSS with a different file name

The reason these file are rmoved relates to their size. They're very big files. (also, I'm picky: GitHub said my repo was mostly CSS, when it's not. It was just the massive size of tailwind)

# ℹ Reference

https://github.com/dwyl/english-words
Expand Down
14 changes: 11 additions & 3 deletions generatePassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ const dictionary = JSON.parse(decoded)
const wordsRaw = fs.readFileSync('words.txt')
const words = wordsRaw.toString().split('\n')

let password = gen()
//console.log(password)

//Return definition of argument
function define(word) {
return dictionary[word.toString().toUpperCase()]
Expand All @@ -27,6 +24,7 @@ function getWordOfLength(num) {
let wordsOfLength = []
words.forEach(word => {
if (word.length === num) {
//Remove words with 's
if (word.indexOf('\'s') === -1) {
wordsOfLength.push(word)
}
Expand Down Expand Up @@ -56,6 +54,10 @@ function isUpperCase(word) {
function gen() {
let characters = [',', '.', '/', '?', ';', ':', '-', '=', '+', '!']
let three = capIt(getRandomFromArray(getWordOfLength(3)))
//For each word in the password, check to see if it's all uppercase.
// If so, start over.
//Then check to see if it has a definition or is an actual word.
// If not, start over.
if (isUpperCase(three) !== true) {
if (define(three) !== undefined) {
let randomNumber = Math.floor(Math.random() * 10)
Expand All @@ -68,6 +70,11 @@ function gen() {
if (define(four) !== undefined) {
let finalRandomNumber = Math.floor(Math.random() * 10)
let final = three + randomNumber + five + character + four + finalRandomNumber
//Test password according to HSIMP
// If it has a level value, start over
// Generally, the level value should only have a value when it's a bad password.
//Maybe add a system that checks the password against the top 10,000 passwords.
// If it does find a match, start over.
let hsimpTest = hsimp(final)
if (hsimpTest.level === null) {
return final
Expand All @@ -94,4 +101,5 @@ function gen() {
}
}

//Export module
exports.gen = gen
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="icon@2x.png" type="image/x-icon">
<link rel="stylesheet" href="tailwind.css">
<link rel="stylesheet" href="style.css">
<title>PPG</title>
</head>
<body>
Expand Down
Loading

0 comments on commit ec278ec

Please sign in to comment.