Password Functions¶
password\generate( )¶
The password\generate() function returns a system generated password.
Example:
password\hash( )¶
The password\hash() function returns a hashed version of the INPUT value. The same input will always generate the same hashed value.
A hash() function is commonly used for storing passwords in a secure and encrypted form. Instead of storing the actual password, which is
considered to be a security risk, a hash function is used to convert the password into a fixed-length string of characters that is unique to
the password. The hash function generates this fixed-length string, known as a hash value, by applying a mathematical algorithm to the password.
Hash functions are designed to be one-way functions, which means they can convert data into a fixed-size string of characters, but the process is not reversible. This property is what makes hashing a secure method for storing passwords, as it prevents anyone from retrieving the original password from the hash.
When a user enters their password to log in, the hash function is applied again to the entered password, and the resulting hash value is compared to the hash value stored in the database. If the two hash values match, it means that the entered password is correct, and the user is granted access. However, if the two hash values do not match, it means that the entered password is incorrect, and the user is denied access.
Hashing passwords is considered to be a best practice in terms of security because it ensures that even if a hacker gains access to the database, they will not be able to retrieve the actual passwords. Instead, they will only be able to see the hash values, which are typically very difficult to reverse engineer. This means that even if a hacker knows the hash value, they cannot use it to log in to the system or access the user's account.
Example:
$password = password\generate(); // Example result: '8jD4nEHI0S'
$hash = password\hash($password); // Returns 'AwDaMjhIxapOxYkDL.RcXVOsSLeor4ylM8qszx.CI5mAqeEkaV84WwxaUBjpbbrCgzMeu7DR0Y6M0qOyrxBQ11'
See Also¶
- Array Functions
- Datetime Functions
- Entity Functions
- Env Functions
- Ext Functions
- JSON Functions
- Language Functions
- Number Functions
- Object Functions
- Output Functions
- Password Functions
- Record Functions
- String Functions
- Mythradon Marketing
- Mythradon Sales
- Mythradon Service
- Mythradon System Administration
- Mythradon Tools