diff --git a/reference/openssl/functions/openssl-password-hash.xml b/reference/openssl/functions/openssl-password-hash.xml new file mode 100644 index 000000000000..020713d2157e --- /dev/null +++ b/reference/openssl/functions/openssl-password-hash.xml @@ -0,0 +1,113 @@ + + + + openssl_password_hash + Create a password hash using OpenSSL's Argon2 implementation + + + + &reftitle.description; + + stringopenssl_password_hash + stringalgo + stringpassword + arrayoptions[] + + + Creates a password hash using OpenSSL's Argon2 implementation. This is an + alternative to password_hash that uses OpenSSL as + the backend, which may offer hardware acceleration on some platforms. + + + + This function is only available when PHP is compiled with OpenSSL + support that includes Argon2 (HAVE_OPENSSL_ARGON2). + + + + + + &reftitle.parameters; + + + + algo + + + The password hashing algorithm. Supported values: + "argon2id" and "argon2i". + + + + + password + + + The user's password. + + + + + options + + + An associative &array; of options. Supported keys: + + + memory_cost - Maximum memory (in KiB) that may + be used to compute the hash + + + time_cost - Maximum amount of time it may take + to compute the hash + + + threads - Number of threads to use for + computing the hash + + + + + + + + + + + &reftitle.returnvalues; + + Returns the password hash as a &string;. + + + + + &reftitle.seealso; + + + openssl_password_verify + password_hash + + + + + + diff --git a/reference/openssl/functions/openssl-password-verify.xml b/reference/openssl/functions/openssl-password-verify.xml new file mode 100644 index 000000000000..1f2c97732e7d --- /dev/null +++ b/reference/openssl/functions/openssl-password-verify.xml @@ -0,0 +1,92 @@ + + + + openssl_password_verify + Verify a password against a hash using OpenSSL's Argon2 implementation + + + + &reftitle.description; + + boolopenssl_password_verify + stringalgo + stringpassword + stringhash + + + Verifies that a password matches a hash created by + openssl_password_hash. + + + + + &reftitle.parameters; + + + + algo + + + The password hashing algorithm. Supported values: + "argon2id" and "argon2i". + + + + + password + + + The user's password. + + + + + hash + + + A hash created by openssl_password_hash. + + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the password and hash match, or &false; otherwise. + + + + + &reftitle.seealso; + + + openssl_password_hash + password_verify + + + + + +