bitbeans / KnownPasswords by bitbeans

Laravel 5.x package to access the knownpasswords.org API
6
4
2
Package Data
Maintainer Username: bitbeans
Maintainer Contact: c.hermann@bitbeans.de (Christian Hermann)
Package Create Date: 2015-10-12
Package Last Update: 2015-10-22
Home Page: https://knownpasswords.org
Language: PHP
License: MIT
Last Refreshed: 2024-11-21 03:00:10
Package Statistics
Total Downloads: 6
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 4
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

KnownPasswords

KnownPasswords for Laravel 5

Requires:

  • libsodium-php
  • a knownpasswords.org registration

Installation

Add bitbeans/knownpasswords to composer.json.

"bitbeans/knownpasswords": "dev-master"

Run composer update to pull down the latest version of KnownPasswords.

Now open up PROJECTFOLDER/config/app.php and add the service provider to your providers array.

'providers' => array(
	'Bitbeans\KnownPasswords\KnownPasswordsServiceProvider',
)

And also the alias.

'aliases' => array(
	'KnownPasswords' => 'Bitbeans\KnownPasswords\KnownPasswordsFacade',
)

Configuration

Run php artisan vendor:publish and modify the config file (PROJECTFOLDER/config/knownpasswords.php) with your own information.

Example


	<?php namespace App\Services\Validation;

	use KnownPasswords;

	class MyValidation {

		public function validateKnownPassword($attribute, $value, $parameters) {
			try {
				return KnownPasswords::checkPassword($value);
			}
			catch (\Exception $e)
			{
				return false;
			}
			return false;
		}
	}

Note

KnownPasswords can validate the following password formats:

  • Blake2b (64 byte hash)
  • Sha512 (64 byte hash)
  • Cleartext password

Never store passwords in these formats, always us a KDF (key derivation function)!