Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mtchavez/common-pw

Common password checker - probable word list
https://github.com/mtchavez/common-pw

password-checker password-safety password-strength password-validator

Last synced: 24 days ago
JSON representation

Common password checker - probable word list

Awesome Lists containing this project

README

        

# Common Password Checker

common-pw is a go packge implementing a JSON API endpoint to check if a password
is in the top X most commonly used. Data is used from [Probable Word List][pwl]

## Usage

### Installing

Clone repo `git clone https://github.com/mtchavez/common-pw`

#### Large Datasets

Download the data from the [probable word list][pwl] repository and place
in the data directory. Currently `Top32Million-probable.txt` is not in version
control because of size.

### Server

Run the server on port 3000 with `go run main.go`. The password filters will
build in the background and can take ~20 seconds to build. The time it took to
build will be logged out.

### Checking Passwords

Use cURL or something similar to post to `/validate` with a JSON body:

```json
{
"password": "the password to check"
}
```

**Examples:**

```
$ curl -s -XPOST -H "Content-Type: application/json" http://localhost:3000/validate --data '{"password": "iloveyou"}' | jq
{
"status": "OK",
"top196": "true",
"top3575": "true",
"top95k": "true"
}
```
---
```
$ curl -s -XPOST -H "Content-Type: application/json" http://localhost:3000/validate --data '{"password": "annabelle"}' | jq
{
"status": "OK",
"top196": "false",
"top3575": "true",
"top95k": "true"
}
```
---
```
$ curl -s -XPOST -H "Content-Type: application/json" http://localhost:3000/validate --data '{"password": "!@#$%^&*("}' | jq
{
"status": "OK",
"top196": "false",
"top3575": "false",
"top95k": "true"
}
```
---
```
$ curl -s -XPOST -H "Content-Type: application/json" http://localhost:3000/validate --data '{"password": "Portlandia"}' | jq
{
"status": "OK",
"top196": "false",
"top3575": "false",
"top95k": "false"
}
```
---
```
$ curl -s -XPOST -H "Content-Type: application/json" http://localhost:3000/validate --data '{"password": "Portlandia"}' | jq
{
"status": "OK",
"top196": "false",
"top32m": "true",
"top3575": "false",
"top95k": "false"
}
```
---
**A password is required**
```
$ curl -s -XPOST -H "Content-Type: application/json" http://localhost:3000/validate --data '{}' | jq
{
"error": "a password must be provided",
"status": "failed"
}
```

[pwl]: https://github.com/berzerk0/Probable-Wordlists