Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

valters-tomsons/SharpPwned.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 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 = await client.IsPasswordPwned("hunter2");
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 = await client.GetAccountBreaches("gaben@valvesoftware.com");
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 2.1

Nuget Package:

PM> Install-Package SharpPwned.NET