<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.hash.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'intro.hash.php',
    1 => 'Вступ',
    2 => 'Вступ',
  ),
  'up' => 
  array (
    0 => 'book.hash.php',
    1 => 'Hash',
  ),
  'prev' => 
  array (
    0 => 'book.hash.php',
    1 => 'Hash',
  ),
  'next' => 
  array (
    0 => 'hash.setup.php',
    1 => 'Встановлення/налаштування',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/hash/book.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="intro.hash" class="preface">
  <h1 class="title">Вступ</h1>
  <p class="para">
   This extension provides functions that can be used for direct or
   incremental processing of arbitrary length messages using a variety of
   hashing algorithms, including the generation of <abbr title="Hash-based Message Authentication Code">HMAC</abbr>
   values and key derivations including <abbr title="HMAC Key Definition Function">HKDF</abbr> and
   <abbr title="Password-Based Key Derivation Function 2">PBKDF2</abbr>.
  </p>
  <p class="para">
   There are roughly three categories of hashing algorithms, and a complete list of
   algorithms can be found in the documentation for <span class="function"><a href="function.hash-algos.php" class="function">hash_algos()</a></span>.

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      Checksum algorithms (such as <code class="literal">&quot;crc32b&quot;</code> or <code class="literal">&quot;adler32&quot;</code>):
      These are used to calculate checksums, useful in situations such as when
      transmission errors are to be detected. They are often very fast. These
      algorithms often generate values that are easily &quot;guessable&quot; or can be manipulated
      to create collisions, so they are entirely unsuitable for cryptographic use.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Non-cryptographic algorithms (such as the xxHash family):
      These are often used to calculate hash values for hash tables, as they are
      designed to yield a good distribution over arbitrary string inputs. They
      are also generally fast, but also not suitable for cryptographic use.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Cryptographic algorithms (such as the SHA-2 family):
      These are designed to yield hash values that are representative of their
      inputs but are not guessable nor prone to collisions. Performance is often
      a secondary concern, but modern hardware often supports special handling
      for these algorithms that PHP tries to use when available.
     </span>
     <span class="simpara">
      The Computer Security Resource Center of the <abbr>NIST</abbr> has
      <a href="https://csrc.nist.gov/projects/hash-functions" class="link external">&raquo;&nbsp;explanation of the algorithms
      currently approved by United States Federal Information Processing
      Standards</a>.
     </span>
     <div class="caution"><strong class="caution">Застереження</strong>
      <p class="para">
       Some of the early cryptographic algorithms, such as <code class="literal">&quot;md4&quot;</code>,
       <code class="literal">&quot;md5&quot;</code>, and <code class="literal">&quot;sha1&quot;</code>, have been proven
       to be prone to collision attacks and it is generally recommended to no
       longer use these for cryptographic applications.
      </p>
     </div>
    </li>
   </ul>
  </p>

  <p class="para">
   See also the <a href="faq.passwords.php" class="link">FAQ on Safe Password Hashing</a>
   for information on best practices for using hash functions in handling
   passwords.
  </p>
 </div><?php manual_footer($setup); ?>