Coder Social home page Coder Social logo

pwnage.rs's Introduction

pwnage.rs

crates.io

Have I Been Pwned API v3 library

Documentation: Have I Been Pwned: API v3

HIBP API

Options Description Arguments
breached_account all breaches for an account (truncated response) account
breached_account_full all breaches for an account account
breached_account_by_domain all breaches for an account by domain (truncated response) account, domain
breached_account_by_domain_full all breaches for an account by domain account, domain
breaches all breached sites -
breaches_by_domain breached sites in the system by domain domain
breach single breached site name
data_classes all data classes -
paste_account all pastes for an account account
pwned_passwords search Pwned Passwords password

Example

let api_key = String::from("API-KEY"); // HIBP API Key
let user_agent = String::from("GitHub.com/OptionalValue");
let hibp = pwnage::HIBP::new(api_key, user_agent);
let email_address = "[email protected]"; // Email Address
let breaches = hibp.breached_account_full(email_address)?;
	for breach in &breaches {
        println!(
            "Name: {:?} | Title: {:?} | Date: {:?}",
            breach.name, breach.title, breach.breach_date
        );
}

Pwned Passwords

Pwnage sends the first five characters of the password hash to HIBP and receives the suffixes of the matching prefix. Pwnage compares the suffix locally and returns the result.

Options Description Arguments
pwned_passwords search Pwned Passwords password

Example

let password = "Password123";
let user_agent = "GitHub.com/OptionalValue";
let pwned_password = pwnage::pwned_passwords(password, user_agent)?;
println!(
    "Pwned?: {:?} | Times: {:?}",
    pwned_password.pwned, pwned_password.times
);

pwnage.rs's People

Contributors

cak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nusiloot

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.