<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.openssl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'function.openssl-password-hash.php',
    1 => 'openssl_password_hash',
    2 => 'Create a password hash using OpenSSL\'s Argon2 implementation',
  ),
  'up' => 
  array (
    0 => 'ref.openssl.php',
    1 => 'OpenSSL İşlevleri',
  ),
  'prev' => 
  array (
    0 => 'function.openssl-open.php',
    1 => 'openssl_open',
  ),
  'next' => 
  array (
    0 => 'function.openssl-password-verify.php',
    1 => 'openssl_password_verify',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/openssl/functions/openssl-password-hash.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.openssl-password-hash" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_password_hash</h1>
  <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">openssl_password_hash</span> &mdash; <span class="dc-title">Create a password hash using OpenSSL&#039;s Argon2 implementation</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.openssl-password-hash-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_password_hash</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$algo</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$password</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$options</code><span class="initializer"> = []</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Creates a password hash using OpenSSL&#039;s Argon2 implementation. This is an
   alternative to <span class="function"><a href="function.password-hash.php" class="function">password_hash()</a></span> that uses OpenSSL as
   the backend, which may offer hardware acceleration on some platforms.
  </p>
  <p class="para">
   This function is only available when PHP is compiled with OpenSSL
   support that includes Argon2 (<code class="literal">HAVE_OPENSSL_ARGON2</code>).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-password-hash-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">algo</code></dt>
     <dd>
      <p class="para">
       The password hashing algorithm. Supported values:
       <code class="literal">&quot;argon2id&quot;</code> and <code class="literal">&quot;argon2i&quot;</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">password</code></dt>
     <dd>
      <p class="para">
       The user&#039;s password.
      </p>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       An associative <span class="type"><a href="language.types.array.php" class="type array">array</a></span> of options. Supported keys:
       <ul class="simplelist">
        <li>
         <code class="literal">memory_cost</code> - Maximum memory (in KiB) that may
         be used to compute the hash
        </li>
        <li>
         <code class="literal">time_cost</code> - Maximum amount of time it may take
         to compute the hash
        </li>
        <li>
         <code class="literal">threads</code> - Number of threads to use for
         computing the hash
        </li>
       </ul>
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-password-hash-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">
   Returns the password hash as a <span class="type"><a href="language.types.string.php" class="type string">string</a></span>.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.openssl-password-hash-errors">
  <h3 class="title">Hatalar/İstisnalar</h3>
  <p class="para">
   Throws a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> if <code class="parameter">algo</code>
   is not one of the supported values
   (<code class="literal">&quot;argon2i&quot;</code> or <code class="literal">&quot;argon2id&quot;</code>).
  </p>
  <p class="para">
   Throws an <span class="classname"><a href="class.error.php" class="classname">Error</a></span> if the hashing operation fails
   for an unknown reason.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.openssl-password-hash-changelog">
  <h3 class="title">Sürüm Bilgisi</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Sürüm: </th>
      <th>Açıklama</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       Function added.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.openssl-password-hash-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="example-1">
   <p><strong>Örnek 1 <span class="function"><strong>openssl_password_hash()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$hash </span><span style="color: #007700">= </span><span style="color: #0000BB">openssl_password_hash</span><span style="color: #007700">(</span><span style="color: #DD0000">'argon2id'</span><span style="color: #007700">, </span><span style="color: #DD0000">'my-secret-password'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$hash</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>
Yukarıdaki örnek şuna benzer bir çıktı üretir:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">$argon2id$v=19$m=65536,t=4,p=1$c29tZXNhbHR2YWx1ZQ$hashvalue...</pre>
</div>
   </div>
  </div>
  <div class="example" id="example-2">
   <p><strong>Örnek 2 <span class="function"><strong>openssl_password_hash()</strong></span> with custom options</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$hash </span><span style="color: #007700">= </span><span style="color: #0000BB">openssl_password_hash</span><span style="color: #007700">(</span><span style="color: #DD0000">'argon2id'</span><span style="color: #007700">, </span><span style="color: #DD0000">'my-secret-password'</span><span style="color: #007700">, [<br />    </span><span style="color: #DD0000">'memory_cost' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">65536</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'time_cost'   </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">4</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'threads'     </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">1</span><span style="color: #007700">,<br />]);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.openssl-password-hash-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.openssl-password-verify.php" class="function" rel="rdfs-seeAlso">openssl_password_verify()</a> - Verify a password against a hash using OpenSSL's Argon2 implementation</span></li>
    <li><span class="function"><a href="function.password-hash.php" class="function" rel="rdfs-seeAlso">password_hash()</a> - Parola aşı oluşturur</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>