Git Product home page Git Product logo

philo / isitpwned Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 16 KB

Provides a simple interface (netstandard1.3 and .net461) to the I Have Been Pwned V2 breached password endpoint using the enhanced anonymity provided by the k-Anonymity method (/range endpoint). See Troy Hunt's blog for more details (https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/)

License: MIT License

C# 64.53% PowerShell 35.47%
hibp password-safety csharp netcore net461

isitpwned's Introduction

IsItPwned

Provides a simple interface to the I Have Been Pwned V2 breached password endpoint using the enhanced anonymity provided by the k-Anonymity method (/range endpoint).

Clearly all the credit should goto Troy Hunt, I would encourage you to read his blog on regarding the release of the V2 API.

I've Just Launched "Pwned Passwords" V2 With Half a Billion Passwords for Download

The exact documentation for the API is also available on the Have I Been Pwned website.

Build Status

Build status

Install via NuGet

NuGet

Install-Package IsItPwned

Usage

Take a look at the unit tests for examples of the usage, there really isnt anything to it!

    // Create a client, optionally you can pass in your own HttpClient
    var client = new PwnedPasswordClient();

    var countOfPasswordInBreaches = await client.IsPwnedAsync(password);

    Assert.True(countOfPasswordInBreaches == 0, "Hooray, this password does not exist in half a billion breaches passwords");
    Assert.True(countOfPasswordInBreaches > 0, "Oh no, this password exists in at least one data breach");
    Assert.True(countOfPasswordInBreaches > 1000, "Oh dear, this really is a popular password!!");

As you can see, the .IsPwnedAsync() call simply returns the number of breaches found, you can then determine whether you would be accept or deny the use of the password based on your requirements.

Credit

Troy Hunt Website | Twitter

isitpwned's People

Contributors

philo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.