![]() |
The openssl_pbkdf2() function is an inbuilt function in PHP that implements the Password-Based Key Derivation Function 2 (PBKDF2) algorithm provided by the OpenSSL library. The algorithm is designed to be slow and computationally intensive, making it resistant to brute-force attacks. Syntax: openssl_pbkdf2( string $password, string $salt, int $key_length, int $iterations, string $digest_algo = "sha1" ) : string|false Parameters: This function accepts five parameters that are described below:
Return Value: The return value of openssl_pbkdf2() is a binary string containing the derived key. If failure, it will return “false”. Example 1: The following example demonstrates the openssl_pbkdf2() function. PHP
Output
Password is invalid. Example 2: The following example demonstrates the openssl_pbkdf2() function. PHP
Output: Secure Token: LWL+RuQr+TmOysJt8CBrKu5yC8vk2f9aMBH9y1xK82Nz4dDd88dd+8QqssBgoMDnGD9D5kTcmAlldzz7hUStjw== Reference: https://www.php.net/manual/en/function.openssl-pbkdf2.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 17 |