Enzoic 2.0.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Enzoic --version 2.0.0.4                
NuGet\Install-Package Enzoic -Version 2.0.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Enzoic" Version="2.0.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Enzoic --version 2.0.0.4                
#r "nuget: Enzoic, 2.0.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Enzoic as a Cake Addin
#addin nuget:?package=Enzoic&version=2.0.0.4

// Install Enzoic as a Cake Tool
#tool nuget:?package=Enzoic&version=2.0.0.4                

Enzoic .NET Client Library

TOC

This README covers the following topics:

Installation

The compiled library is available from NuGet:

Nuget

Install-Package Enzoic

API Overview

Here's the API in a nutshell.

// Create a new Enzoic instance - this is our primary interface for making API calls
Enzoic enzoic = new Enzoic("YOUR_API_KEY", "YOUR_API_SECRET");
 
// Check whether a password has been compromised
if (enzoic.CheckPassword("password-to-test")) {
    Console.WriteLine("Password is compromised");
}
else {
    Console.WriteLine("Password is not compromised");
}
 
// Check whether a specific set of credentials are compromised
if (enzoic.CheckCredentials("test@enzoic.com", "password-to-test")) {
    Console.WriteLine("Credentials are compromised");
}
else {
    Console.WriteLine("Credentials are not compromised");
}

// Use the optional parameters on the CheckCredentials call to tweak performance by including the
// date/time of the last check and excluding BCrypt
if (enzoic.CheckCredentials("test@enzoic.com", "password-to-test",
        lastCheckTimestamp, new PasswordType[] { PasswordType.BCrypt })) {
    Console.WriteLine("Credentials are compromised");
}
else {
    Console.WriteLine("Credentials are not compromised");
}

 
// get all exposures for a given user
ExposuresResponse exposures = enzoic.GetExposuresForUser("test@enzoic.com");
Console.WriteLine(exposures.Count + " exposures found for test@enzoic.com");
 
// now get the full details for the first exposure returned in the exposures response
ExposureDetails details = enzoic.GetExposureDetails(exposures.Exposures[0]);
Console.WriteLine("First exposure for test@enzoic.com was " + details.Title);

More information in reference format can be found below.

The Enzoic constructor

The standard constructor takes the API key and secret you were issued on Enzoic signup.

Enzoic enzoic = new Enzoic("YOUR_API_KEY", "YOUR_API_SECRET");

If you were instructed to use an alternate API endpoint, you may call the overloaded constructor and pass the base URL you were provided.

Enzoic enzoic = new Enzoic("YOUR_API_KEY", "YOUR_API_SECRET", "https://api-alt.enzoic.com/v1");

ExposuresResponse

The Enzoic.GetExposuresForUser method returns the response object below.

    /// <summary>
    /// Response object for the Enzoic.GetExposuresForUser method
    /// </summary>
    public class ExposuresResponse
    {
        /// <summary>
        /// The number of items in the exposures array
        /// </summary>
        public int Count { get; set; }

        /// <summary>
        /// An array of Exposure IDs. The IDs can be used with the GetExposureDetails call to retrieve additional info on each exposure.
        /// </summary>
        public String[] Exposures { get; set; }
    }

ExposureDetails

The Enzoic.GetExposureDetails method returns the response object below.

    /// <summary>
    /// The detailed information about a given credentials Exposure.  
    /// </summary>
    public class ExposureDetails
    {
        /// <summary>
        /// The ID of the exposure
        /// </summary>
        public String ID { get; set; }

        /// <summary>
        /// Title of the exposure - for breaches, the domain of the origin site
        /// </summary>
        public String Title { get; set; }

        /// <summary>
        /// The number of credentials found in the exposure
        /// </summary>
        public int Entries { get; set; }

        /// <summary>
        /// The date the exposure occurred, as much as is known. The value is as follows:
        /// *      - null if the date is not known
        /// *      - Month and day set to December 31st, if only the year is known(e.g. "2015-12-31" if Exposure date was sometime in 2015)
        /// *      - Day set to the first of the month if only the month is known(e.g. "2015-06-01" if Exposure date was sometime in June 2015)
        /// *      - Otherwise, exact date if exact date is known, including time
        /// </summary>
        public DateTime Date { get; set; }

        /// <summary>
        /// A category for the origin website, if the exposure was a data breach.
        /// </summary>
        public String Category { get; set; }

        /// <summary>
        /// The format of the passwords in the Exposure, e.g. "Cleartext", "MD5", "BCrypt", etc.
        /// </summary>
        public String PasswordType { get; set; }

        /// <summary>
        /// The types of user data which were present in the Exposure, e.g. "Emails", "Passwords", "Physical Addresses", "Phone Numbers", etc.
        /// </summary>
        public String[] ExposedData { get; set; }

        /// <summary>
        /// The date the Exposure was found and added to the Enzoic database.
        /// </summary>
        public DateTime DateAdded { get; set; }

        /// <summary>
        /// An array of URLs the data was found at. Only present for some types of Exposures, like when the source was a paste site.
        /// </summary>
        public String[] SourceURLs { get; set; }

        /// <summary>
        /// The number of unique email address domains in this Exposure. So, for instance, if the Exposure only contained "gmail.com" and "yahoo.com" email addresses, this number would be 2.
        /// </summary>
        public int DomainsAffected { get; set; }
    }

License

This code is free to use under the terms of the MIT license.

Product Compatible and additional computed target framework versions.
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.5.0 352 7/31/2023
4.4.0 1,482 5/5/2023
4.3.1 626 10/21/2022
4.3.0 398 10/21/2022
4.2.4 1,407 6/17/2022
4.2.3 1,154 1/15/2022
4.1.2 416 12/14/2021
4.1.1 347 11/30/2021
4.1.0 331 11/10/2021
4.0.0 334 11/3/2021
3.1.0 543 6/18/2021
3.0.0 447 6/11/2021
2.0.1.5 442 2/27/2021
2.0.0.4 1,197 7/1/2019

Modified to use new, more secure partial hash matching for Passwords and Credentials calls.  Also, added support for additional password hash algorithms.