Download the PHP package tuzelko/yii2-pwned-passwords without Composer

On this page you can find all versions of the php package tuzelko/yii2-pwned-passwords. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-pwned-passwords

Yii2 Pwned Passwords extension

Project Status: Active Tests Latest Version PHP Version Total Downloads License

Password breach check for the Yii2 framework, backed by the Have I Been Pwned Pwned Passwords API.

Checks whether a password appears in known data breaches without ever sending the password (or its full hash) anywhere — only the first 5 characters of the SHA-1 hash are transmitted (k-anonymity model), and the match is performed locally.

Features

Requirements

Installation

Quick start

Or register it as an application component:

Usage in a validator

A typical place for a breach check is a password policy validator on a form:

Configuration

Property Type Default Description
apiUrl string https://api.pwnedpasswords.com API base URL (override for a proxy or a self-hosted mirror)
padding bool false Send Add-Padding: true so responses are padded with fake zero-hit entries and their size leaks nothing about the requested range
requestOptions array [] Extra Guzzle request options merged into every API call (timeouts, proxy, headers, ...)

HTTP client resolution

On init() the component looks for a GuzzleHttp\ClientInterface definition in Yii::$container:

Error handling

Condition Result
Empty password InvalidArgumentException
Transport / HTTP error (4xx, 5xx, timeout) GuzzleHttp\Exception\GuzzleException
Unexpected non-200 success status RuntimeException

The component never fails silently — decide at the call site whether a check failure should block the user (fail-closed) or be ignored (fail-open).

How k-anonymity works

  1. The password is hashed with SHA-1 locally.
  2. Only the first 5 characters of the hash are sent: GET /range/5BAA6.
  3. The API returns every known hash suffix in that range (~800–1000 entries) with breach counts.
  4. The full hash is matched against the list locally.

The API operator never learns the password, its hash, or even whether a match occurred.

Running tests

Tests run inside Docker (PHP 8.3) with no local setup required and no real HTTP calls (Guzzle mock handler).

License

MIT — see LICENSE.


All versions of yii2-pwned-passwords with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
yiisoft/yii2 Version ~2.0
guzzlehttp/guzzle Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tuzelko/yii2-pwned-passwords contains the following files

Loading the files please wait ...