Latest0.1.4
Homepagehttps://github.com/foffer/PwnedPasswords
LicenseMIT
Platformsios 10.0
Authors

CI Status
Version
License
Platform

Requirements

Swift 4.0

Important

This library never sends the password over the network nor does it store the passwords processed. You can read about how it works here

Installation

PwnedPasswords is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'PwnedPasswords'

or with Swift Package Manager

  .package(url: "https://github.com/foffer/PwnedPasswords.git", .branch("master"))

Usage

class ViewController: UIViewController {

  @IBOutlet weak var textField: UITextField!

  @IBAction func buttonDidPress(_ sender: Any) {
    guard let text = textField.text else { return }
    let client = PwnedPasswords()

    client.check(text) { occurences, error in
      guard error == nil else {
        print(error)
        return
      }

      if let occurences = occurences {
        if occurences > 0 {
          print("🛑 The password you entered has been in a breach")
        } else {
          print("✅ The password you entered was not found")
        }
      }
    }
  }
}

Disclaimer

This is a wrapper over haveibeenpwned.com/Passwords created by Troy Hunt. Troy has created this service and is serving it up himself. Please use responsibly. Thanks to Troy for creating amazing things like these 🎉

Libraries

SHA1 algorithm taken from https://github.com/idrougge/sha1-swift

Author

foffer, [email protected]

License

PwnedPasswords is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "PwnedPasswords",
    "version": "0.1.4",
    "summary": "A small Swift wrapper for haveibeenpwned.com/Passwords",
    "description": "PwnedPasswords is a small wrapper around Troy Hunts Pwned Passwords service, haveibeenpwned.com/Passwords. It's written in Swift and requires Swift 4.0",
    "homepage": "https://github.com/foffer/PwnedPasswords",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "foffer": "[email protected]"
    },
    "source": {
        "git": "https://github.com/foffer/PwnedPasswords.git",
        "tag": "0.1.4"
    },
    "social_media_url": "https://twitter.com/foffer",
    "swift_version": "4.0",
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "PwnedPasswords/Classes/**/*"
}

Pin It on Pinterest

Share This