Skip to content

Check password safety en masse against the Pwned Passwords API (https://pwnedpasswords.com)

Notifications You must be signed in to change notification settings

dbarbuzzi/passcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

passcheck

passcheck is a package and CLI tool to check passwords against the Pwned Password API.

Usage

Package

First, install the package:

go get -u github.com/dbarbuzzi/passcheck

The simplest use-case is to create a new API client using NewPwnedPasswords and then pass a password and the client to Check to get the pwnage results for that password:

// main.go
package main

import (
	"fmt"

	"github.com/dbarbuzzi/passcheck"
)

func main() {
	client, err := passcheck.NewPwnedPasswords("https://api.pwnedpasswords.com")
	if err != nil {
		panic(err)
	}

	count, err := passcheck.Check("password", client)
	if err != nil {
		panic(err)
	}

	fmt.Printf("Password has been pwned %d times.\n", count)
}
$ go run main.go
Password has been pwned 3730471 times.

A few other functions are available to check a hash instead of a password (so you don’t need to give the password to this package) or to check multiple passwords/hashes.

CLI

Coming soon!

About

Check password safety en masse against the Pwned Passwords API (https://pwnedpasswords.com)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages