Repository navigation
CoreySecurity
The CoreySecurity class is a robust, zero-dependency cryptographic and identity toolkit designed for modern PHP applications. Rather than scattering security logic across multiple helpers, this class unifies secure generation, safe hashing, and password analysis into a single, cohesive engine.
$sec = new CoreySecurity(array $userConfig);
userConfig : An array of initial configuration options; alternatively, use setConfig() to update these values later.
The following methods are used to set configuration options.
- loadCustomBlacklist - Add words to the leet-speak blacklist
The following methods manage global configuration states.
- getAlgorithm - Retrieves active hashing algorithm
- listAlgorithms - List available hashing algorithms
- setAlgorithm - Sets the active hashing algorithm
The following methods generate secure, highly complex, unpredictable, high-entropy raw data.
- credentialGen - Generates credentials including password, salt, hashed(salt + password), and algorithm used
- idGen - ID generator
- passGen - Generates a secure password
- saltGen - Generates a secure salt string
The following methods handle the secure storage and verification of sensitive data.
- hash - Generates a hash of a single string value
- passHash - Creates a password hash by combining a password with a salt
The following methods provide analytical intelligence, evaluating the quality of input data.
- passEntropy - Calculates the entropy of a given password
- passStrength - Evaluates the security strength of a given password
The following methods are either private or protected. They are documented here for developers who wish to extend this class.
- algorithmExists - Verify hashing algorithm
- passCheck - Evaluates a generated password
-
errorHash - Generates random
error_hex string - getSymbols - Returns password generation symbols list
- passCodeMsg - Descriptive message for password attribute score
- scoreStrength - Format a score
- validatePool - Validates password character pool
| Variable | Description | Example |
|---|---|---|
| algo | The currently selected hashing algorithm. | $sec->algo |
Refer to the Configuration Documentation section for a complete overview.
Home | CoreySecurity