Git Product home page Git Product logo

passwordping-wincpp-client's Introduction

PasswordPing Client DLL for Windows

TOC

This README covers the following topics:

Installation

Clone the source from Github, open the solution in Visual Studio and compile the DLL.

API Overview

Here's the API in a nutshell. This is from the passwordping-wincpp-client-example application.

// first initialize the library with your API key and secret.  This should always be the first call
// made after loading the library.
DWORD dwResult = InitPasswordPing(
    L"YOUR_API_KEY", 
    L"YOUR_API_SECRET", 
    0 /* a timeout value in ms for API calls, or 0 for default timeout */, 
    NULL /* proxy server address */
);

BOOL bResult = FALSE;

// Call CheckPassword and check a password known to be compromised.
dwResult = CheckPassword(L"123456", &bResult);

// If successful, bResult wil contain the compromise status (true for compromised and false for not)
if (dwResult == ERROR_SUCCESS) {
	wcout << "Password: 123456, Result: " << (bResult ? "bad" : "good") << "\n";
}
else {
	wcout << "Error checking password: " << dwResult << "\n";
}

// Now call CheckPassword with a password known to not be compromised. 
dwResult = CheckPassword(L"thisisnotabadpassword", &bResult);

// If successful, bResult wil contain the compromise status (true for compromised and false for not)
if (dwResult == ERROR_SUCCESS) {
	wcout << "Password: thisisnotabadpassword, Result: " << (bResult ? "bad" : "good") << "\n";
}
else {
	wcout << "Error checking password: " << dwResult << "\n";
}

More information in reference format can be found below.

InitPasswordPing

Must be the first call made after loading the library, prior to calling CheckPassword. The first two arguments are null-terminated strings containing the API key and secret you were issued on PasswordPing signup. The third argument is a timeout value, expressed in milliseconds, to use when making calls to the PasswordPing API. If 0 is specified for the timeout, the default timeout of 30 seconds is used. The last argument is the address of an HTTP proxy server to use, if desired. The server address should be in the format :, e.g. "127.0.0.1:8123". InitPasswordPing returns a standard Windows error code response.

DWORD dwResult = InitPasswordPing(
    L"YOUR_API_KEY", 
    L"YOUR_API_SECRET", 
    0 /* a timeout value in ms for API calls, or 0 for default timeout */, 
    NULL /* proxy server address */
);

CheckPassword

Checks a password for compromised status against the PasswordPing Passwords API. The first parameter is a null-terminated string containing the password to check. The second parameter is a pointer to a boolean which will receive the compromised status of the password. Returns a standard Windows error code response. If InitPasswordPing has not been called, returns ERROR_NOT_READY. If an invalid API key or Secret were provided, returns ERROR_NOT_AUTHENTICATED. If the request times out, ERROR_WINHTTP_TIMEOUT is returned.

BOOL bResult;
DWORD dwResult = CheckPassword(L"password", &bResult);

License

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

passwordping-wincpp-client's People

Stargazers

Mike Wilson avatar

Watchers

James Cloos avatar Mike Wilson 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.