Download the PHP package philiprehberger/php-password-strength without Composer

On this page you can find all versions of the php package philiprehberger/php-password-strength. 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 php-password-strength

PHP Password Strength

Tests Latest Version on Packagist Last updated

Password strength validation with entropy calculation and common password detection.

Requirements

Installation

Usage

Checking password strength

Quick validation

Detailed analysis

Custom dictionary

Personal context checking

Policy-based validation

API

PasswordStrength

Method Description
PasswordStrength::check(string $password): StrengthResult Analyse a password and return a result
PasswordStrength::isStrong(string $password, int $minScore = 3): bool Returns true if the score meets the minimum
PasswordStrength::analyze(string $password): StrengthReport Return a detailed strength report with analysis flags
PasswordStrength::meetsPolicy(string $password, PasswordPolicy $policy): bool Check if a password satisfies a policy
PasswordStrength::addDictionary(array $words): void Add custom dictionary words to check against
PasswordStrength::clearDictionaries(): void Clear all custom dictionaries
PasswordStrength::withContext(array $context): PendingAnalysis Create a pending analysis with personal context

StrengthResult

Property / Method Type Description
score int Strength score from 0 to 4
entropy float Shannon entropy in bits
isCommon bool Whether the password is in the common list
length int Password length in characters
suggestions array List of improvement suggestions
label(): string — Human label: very weak, weak, fair, strong, very strong
toArray(): array — Serialize to array

StrengthReport

Property Type Description
score int Strength score from 0 to 4
level string Human-readable strength level
hasLowercase bool Whether the password contains lowercase letters
hasUppercase bool Whether the password contains uppercase letters
hasDigits bool Whether the password contains digits
hasSymbols bool Whether the password contains special characters
hasRepeatedChars bool Whether the password has 3+ repeated characters in a row
hasSequentialChars bool Whether the password has 3+ sequential characters
hasKeyboardPattern bool Whether the password contains keyboard patterns
length int Password length in characters
hasPersonalContext bool Whether the password contains personal context information
suggestions array List of improvement suggestions

PendingAnalysis

Method Description
analyze(string $password): StrengthReport Analyze a password with personal context applied

PasswordPolicy

Method Description
minLength(int $length): self Set minimum password length
requireUppercase(): self Require at least one uppercase letter
requireDigits(): self Require at least one digit
requireSymbols(): self Require at least one special character
minScore(int $score): self Set minimum strength score (0-4)
check(string $password): bool Check if a password meets the policy

Score Meanings

Score Label Description
0 Very Weak Trivial or common password
1 Weak Low entropy or very short
2 Fair Moderate entropy, room to improve
3 Strong Good entropy and character variety
4 Very Strong Excellent entropy and length

Development

Support

If you find this project useful:

⭐ Star the repo

🐛 Report issues

💡 Suggest features

❤️ Sponsor development

🌐 All Open Source Projects

💻 GitHub Profile

🔗 LinkedIn Profile

License

MIT


All versions of php-password-strength with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
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 philiprehberger/php-password-strength contains the following files

Loading the files please wait ...