PHP Classes
elePHPant
Icontem

Riddler: Generate passwords according to given criteria

Recommend this page to a friend!
  Info   View files Documentation   View files View files (25)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2018-01-19 (7 months ago) RSS 2.0 feedNot enough user ratingsTotal: 81 All time: 9,134 This week: 294Up
Version License PHP version Categories
riddler 1.0.0The PHP License5PHP 5, Text processing, Security
Description Author

This class can generate passwords according to given criteria.

It can generate text strings that may vary in different aspects using specific classes that define criteria for the characters of the text string.

Currently it provides classes for defining criteria that can be of type contracts, dictionaries, formats, and occurrences.

Recommendations

PHP API Key Generator
A random API key generator to server as access restriction to AP

generate unique id by 11 digi number
generate unique id

  Performance   Level  
Name: DeGraciaMathieu <contact>
Classes: 4 packages by
Country: France France
Innovation award
Innovation award
Nominee: 2x

Details

<p align="center"> <img src="https://i62.servimg.com/u/f62/11/13/61/32/riddle10.png" width="300"> </p> <p align="center"> <a href="https://www.codacy.com/app/DeGraciaMathieu/Riddler?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=DeGraciaMathieu/Riddler&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/d662a4fa526a4a709d3ad1991cba2533" alt="Codacy Badge"></a> <a href="https://scrutinizer-ci.com/g/degraciamathieu/riddler/?branch=master"><img src="https://scrutinizer-ci.com/g/DeGraciaMathieu/Riddler/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality"></a> <a href="https://scrutinizer-ci.com/g/DeGraciaMathieu/Riddler/build-status/master"><img src="https://scrutinizer-ci.com/g/DeGraciaMathieu/Riddler/badges/build.png?b=master" alt="Build Status"></a> <a href="https://scrutinizer-ci.com/g/DeGraciaMathieu/Riddler/?branch=master"><img src="https://scrutinizer-ci.com/g/DeGraciaMathieu/Riddler/badges/coverage.png?b=master" alt="Code Coverage"></a> <a href="https://packagist.org/packages/degraciamathieu/riddler"><img src="https://img.shields.io/packagist/v/degraciamathieu/riddler.svg?style=flat-square" alt="Latest Version on Packagist"></a> </p>

DeGraciaMathieu/Riddler

Password generator service

Installation

Run in console below command to download package to your project:

composer require degraciamathieu/riddler

Usage

A password is a set of one or more criteria composed of a dictionary and an occurrence.

The available dictionaries are : * AccentedLetter * AccentedUppercaseLetter * Digit * Letter * SpecialCharacter * UppercaseLetter

Available occurrences : * Strict * Between

require 'vendor\autoload.php';

use DeGraciaMathieu\Riddler\Password;
use DeGraciaMathieu\Riddler\Dictionaries;
use DeGraciaMathieu\Riddler\Occurrences;

$password = new Password();
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(5));
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Between(3, 6));
$password->generate();

To build passwords faster, it is possible to use a set of prescinded criteria using the formats.

Available formats : * LongDigit * MixedComplex * MixedStrong * SmallAlphanumeric * StrongAlphanumeric

require 'vendor\autoload.php';

use DeGraciaMathieu\Riddler\Password;
use DeGraciaMathieu\Riddler\Formats;

$password = new Password();
$password->addFormat(new Formats\StrongAlphanumeric());
$password->generate();

It is possible to create its own class format implementing the interface DeGraciaMathieu\Riddler\Contracts\Format

Examples

Classics

$password = new Password;
$password->addCriteria(new Digit(), new Strict(10));
$password->generate(); // "4731412968"

$password = new Password;
$password->addCriteria(new Letter(), new Strict(20));
$password->generate(); // "tugmdzkgohnnkfrxuqns"

$password = new Password;
$password->addCriteria(new UppercaseLetter(), new Strict(20));
$password->generate(); // "JDXIRCEBWDPZLCWIJNYZ"

$password = new Password;
$password->addCriteria(new UppercaseLetter(), new Between(5, 7));
$password->addCriteria(new Letter(), new Between(5, 7));
$password->generate(); // "xIXPstuqTZmb"

$password = new Password;
$password->addCriteria(new SpecialCharacter(), new Strict(15));
$password->generate(); // "#^_=%§][:@_]^%="

$password = new Password;
$password->addCriteria(new AccentedLetter(), new Strict(15));
$password->generate(); // "üãöîâüîüûàóäùéú"

$password = new Password;
$password->addCriteria(new AccentedUppercaseLetter(), new Strict(15));
$password->generate(); // "ÂÚÏÝÒÌÀÂÜÝÛËÍÊÌ"

$password = new Password;
$password->addCriteria(new Digit(), new Strict(5));
$password->addCriteria(new Letter(), new Strict(5));
$password->addCriteria(new SpecialCharacter(), new Between(5, 10));
$password->generate(); // "!186u;n&~§3r7hb|~?"

$password = new Password;
$password->addCriteria(new Digit(), new Between(5, 7));
$password->addCriteria(new Letter(), new Between(5, 7));
$password->addCriteria(new UppercaseLetter(), new Between(5, 7));
$password->addCriteria(new AccentedLetter(), new Between(5, 7));
$password->addCriteria(new SpecialCharacter(), new Between(5, 7));
$password->generate(); // "uELòp§iO°L§7b~â]3ûë7èm96A"

Formats

$password = new Password();
$password->addFormat(new Formats\LongDigit());
$password->generate(); // "075197457894437657185665450123"

$password = new Password();
$password->addFormat(new Formats\SmallAlphanumeric());
$password->generate(); // "mA5M6ap167gRTeE"

$password = new Password();
$password->addFormat(new Formats\StrongAlphanumeric());
$password->generate(); // "492OHwdJEdDT5Lb89zhY9c26j4XhmX"

$password = new Password();
$password->addFormat(new Formats\MixedStrong());
$password->generate(); // "41súdSXWHV65k2G0lr0õèñzåY"

$password = new Password();
$password->addFormat(new Formats\MixedComplex());
$password->generate(); // "Äûc[%ÀÁkWï_1V8k3uw*3§ÔEaAÍ+5§ôåûWYI6äÕ7"
  Files folder image Files  
File Role Description
Files folder imagesrc (3 files, 4 directories)
Files folder imagetests (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageContracts (3 files)
Files folder imageDictionaries (6 files)
Files folder imageFormats (5 files)
Files folder imageOccurrences (3 files)
  Plain text file Criteria.php Class Class source
  Plain text file Manager.php Class Class source
  Plain text file Password.php Class Class source

  Files folder image Files  /  src  /  Contracts  
File Role Description
  Plain text file Dictionary.php Class Class source
  Plain text file Format.php Class Class source
  Plain text file Occurrence.php Class Class source

  Files folder image Files  /  src  /  Dictionaries  
File Role Description
  Plain text file AccentedLetter.php Class Class source
  Plain text file AccentedUppercaseLetter.php Class Class source
  Plain text file Digit.php Class Class source
  Plain text file Letter.php Class Class source
  Plain text file SpecialCharacter.php Class Class source
  Plain text file UppercaseLetter.php Class Class source

  Files folder image Files  /  src  /  Formats  
File Role Description
  Plain text file LongDigit.php Class Class source
  Plain text file MixedComplex.php Class Class source
  Plain text file MixedStrong.php Class Class source
  Plain text file SmallAlphanumeric.php Class Class source
  Plain text file StrongAlphanumeric.php Class Class source

  Files folder image Files  /  src  /  Occurrences  
File Role Description
  Plain text file BaseOccurrence.php Class Class source
  Plain text file Between.php Class Class source
  Plain text file Strict.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file Test.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:81
This week:0
All time:9,134
This week:294Up