This README covers the following topics:
Clone the source from Github, open the solution in Visual Studio and compile the DLL.
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.
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 */
);
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);
This code is free to use under the terms of the MIT license.