Skip to content

hoppushoppard/SharpPwned.NET

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SharpPwned.NET

This library wraps HaveIBeenPwned.com v3 RESTful API in .NET Standard.

Remarks

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

Nuget Package:

PM> Install-Package SharpPwned.NET

About

.NET API for haveibeenpwned.com RESTful api

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%