This library wraps HaveIBeenPwned.com v3 RESTful API in .NET Standard.
HaveIBeenPwned.com API version 2 was superseded by version 3.
Breaking changes were introduced, which made version 2 unusable.
Main change was introduction of API key because of continuous abuse (Troy's blog post) of the HaveIBeenPwned service.
Paid API key can be obtained here.
Usage:
var client = new HaveIBeenPwnedRestClient(yourApiKey);
var response = client.IsPasswordPwned("hunter2").Result;
Console.WriteLine(response);
This will return a bool value, depending on if the password is indeed pwned.
using SharpPwned.NET.Model;
var client = new HaveIBeenPwnedRestClient(yourApiKey);
var response = client.GetAccountBreaches("[email protected]").Result;
foreach(Breach x in response)
{
Console.WriteLine(x.Domain);
}
GetAccountBreaches will return a list Breach objects, each Breach represents a single breached site and holds values as Name, Domain, Account Count etc. For full list of values, visit API Documentation.
This project targets .NET Standard 1.4
PM> Install-Package SharpPwned.NET