Documentation

ReverseDictionaryMatch extends DictionaryMatch
in package

Table of Contents

Constants

ALL_LOWER  = "/^[^A-Z]+\$/u"
ALL_UPPER  = "/^[^a-z]+\$/u"
END_UPPER  = "/^[^A-Z]+[A-Z]\$/u"
START_UPPER  = "/^[A-Z][^A-Z]+\$/u"

Properties

$begin  : mixed
$dictionaryName  : string
$end  : mixed
$l33t  : bool
$matchedWord  : string
$password  : mixed
$pattern  : mixed
$rank  : int
$reversed  : bool
$token  : mixed
$rankedDictionaries  : array<string|int, mixed>

Methods

__construct()  : mixed
binom()  : float
Calculate binomial coefficient (n choose k).
findAll()  : array<string|int, mixed>
Find all occurrences of regular expression in a string.
getFeedback()  : array{'warning': string, "suggestions": string[]}
Get feedback to a user based on the match.
getFeedbackWarning()  : string
getGuesses()  : float
getGuessesLog10()  : float
match()  : array<string|int, ReverseDictionaryMatch>
Match occurences of reversed dictionary words in password.
mbStrRev()  : string
dictionaryMatch()  : array<string|int, mixed>
Attempts to find the provided password (as well as all possible substrings) in a dictionary.
getMinimumGuesses()  : float
getRankedDictionaries()  : array<string|int, mixed>
Load ranked frequency dictionaries.
getRawGuesses()  : float
getUppercaseVariations()  : float

Constants

Properties

$dictionaryName

public string $dictionaryName

The name of the dictionary that the token was found in.

$l33t

public bool $l33t = false

Whether or not the token contained l33t substitutions.

$matchedWord

public string $matchedWord

The word that was matched from the dictionary.

$reversed

public bool $reversed = true

Whether or not the matched word was reversed in the token.

$rankedDictionaries

protected static array<string|int, mixed> $rankedDictionaries = []

A cache of the frequency_lists json file

Methods

__construct()

public __construct(string $password, int $begin, int $end, string $token[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
$password : string
$begin : int
$end : int
$token : string
$params : array<string|int, mixed> = []

An array with keys: [dictionary_name, matched_word, rank].

binom()

Calculate binomial coefficient (n choose k).

public static binom(int $n, int $k) : float
Parameters
$n : int
$k : int
Return values
float

findAll()

Find all occurrences of regular expression in a string.

public static findAll(string $string, string $regex[, int $offset = 0 ]) : array<string|int, mixed>
Parameters
$string : string

String to search.

$regex : string

Regular expression with captures.

$offset : int = 0
Return values
array<string|int, mixed>

Array of capture groups. Captures in a group have named indexes: 'begin', 'end', 'token'. e.g. fishfish /(fish)/ array( array( array('begin' => 0, 'end' => 3, 'token' => 'fish'), array('begin' => 0, 'end' => 3, 'token' => 'fish') ), array( array('begin' => 4, 'end' => 7, 'token' => 'fish'), array('begin' => 4, 'end' => 7, 'token' => 'fish') ) )

getFeedback()

Get feedback to a user based on the match.

public getFeedback(bool $isSoleMatch) : array{'warning': string, "suggestions": string[]}
Parameters
$isSoleMatch : bool

Whether this is the only match in the password

Return values
array{'warning': string, "suggestions": string[]}

getFeedbackWarning()

public getFeedbackWarning(bool $isSoleMatch) : string
Parameters
$isSoleMatch : bool
Return values
string

getGuesses()

public getGuesses() : float
Return values
float

getGuessesLog10()

public getGuessesLog10() : float
Return values
float

match()

Match occurences of reversed dictionary words in password.

public static match(mixed $password[, array<string|int, mixed> $userInputs = [] ][, array<string|int, mixed> $rankedDictionaries = [] ]) : array<string|int, ReverseDictionaryMatch>
Parameters
$password : mixed
$userInputs : array<string|int, mixed> = []
$rankedDictionaries : array<string|int, mixed> = []
Return values
array<string|int, ReverseDictionaryMatch>

mbStrRev()

public static mbStrRev(string $string[, string|null $encoding = null ]) : string
Parameters
$string : string
$encoding : string|null = null
Return values
string

dictionaryMatch()

Attempts to find the provided password (as well as all possible substrings) in a dictionary.

protected static dictionaryMatch(string $password, array<string|int, mixed> $dict) : array<string|int, mixed>
Parameters
$password : string
$dict : array<string|int, mixed>
Return values
array<string|int, mixed>

getMinimumGuesses()

protected getMinimumGuesses() : float
Return values
float

getRankedDictionaries()

Load ranked frequency dictionaries.

protected static getRankedDictionaries() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUppercaseVariations()

protected getUppercaseVariations() : float
Return values
float

        
On this page

Search results