A simple, lightweight jQuery plugin for validating if a password has been previously part of a databreach, using https://haveibeenpwned.com api! - example available on gh-pages
If you like jquery.hibp.validate and use it commercially please consider giving a donation. Thankyou.
Include script after the jQuery library
<script src="/path/jquery.hibp.validate.js"></script>
Check if a password is pwned and throw an alert
<script type="text/javascript">
$(function () {
$('form').on('submit', function () {
$(':password').hibpValidate();
return false;
});
$(':password').on('hibp', function(event, data) {
if (data.pwned) {
alert('oh dear, your password is one that is compromised according to Troy! pick another ...');
} else {
alert('your password rocks ...')
}
});
}):
</script>
Check out docs/index.html in the repository or visit our github-page
Author: Carl Woodhouse
Special thanks to Troy Hunt for his awesome api