Sophie

Sophie

distrib > Mageia > cauldron > i586 > by-pkgid > 92a9f9a2ff17105809ab69f8e09db031 > files > 72

botan-doc-1.10.17-7.mga7.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Key Derivation Functions &#8212; Botan</title>
    <link rel="stylesheet" href="_static/agogo.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="PBKDF Algorithms" href="pbkdf.html" />
    <link rel="prev" title="Secure Memory Containers" href="secmem.html" /> 
  </head><body>
    <div class="header-wrapper">
      <div class="header">
        <h1>Botan</h1>
      </div>
    </div>

    <div class="content-wrapper">
      <div class="content">
        <div class="document">
            
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="key-derivation-functions">
<span id="key-derivation-function"></span><h1>Key Derivation Functions<a class="headerlink" href="#key-derivation-functions" title="Permalink to this headline">¶</a></h1>
<p>Key derivation functions are used to turn some amount of shared secret
material into uniform random keys suitable for use with symmetric
algorithms. An example of an input which is useful for a KDF is a
shared secret created using Diffie-Hellman key agreement.</p>
<dl class="class">
<dt id="_CPPv33KDF">
<span id="_CPPv23KDF"></span><span id="KDF"></span><em class="property">class </em><code class="descname">KDF</code><a class="headerlink" href="#_CPPv33KDF" title="Permalink to this definition">¶</a><br /></dt>
<dd><dl class="function">
<dt id="_CPPv3NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteERKNSt6stringE">
<span id="_CPPv2NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteERKNSt6stringE"></span><span id="KDF::derive_key__s.MemoryRegion:byte:CR.ssCRC"></span>SecureVector&lt;byte&gt; <code class="descname">derive_key</code><span class="sig-paren">(</span>size_t <em>key_len</em>, <em class="property">const</em> MemoryRegion&lt;byte&gt; &amp;<em>secret</em>, <em class="property">const</em> std::string &amp;<em>salt</em> = &quot;&quot;<span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv3NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteERKNSt6stringE" title="Permalink to this definition">¶</a><br /></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv3NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteERK12MemoryRegionI4byteE">
<span id="_CPPv2NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteERK12MemoryRegionI4byteE"></span><span id="KDF::derive_key__s.MemoryRegion:byte:CR.MemoryRegion:byte:CRC"></span>SecureVector&lt;byte&gt; <code class="descname">derive_key</code><span class="sig-paren">(</span>size_t <em>key_len</em>, <em class="property">const</em> MemoryRegion&lt;byte&gt; &amp;<em>secret</em>, <em class="property">const</em> MemoryRegion&lt;byte&gt; &amp;<em>salt</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv3NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteERK12MemoryRegionI4byteE" title="Permalink to this definition">¶</a><br /></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv3NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteEPK4byte6size_t">
<span id="_CPPv2NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteEPK4byte6size_t"></span><span id="KDF::derive_key__s.MemoryRegion:byte:CR.byteCP.sC"></span>SecureVector&lt;byte&gt; <code class="descname">derive_key</code><span class="sig-paren">(</span>size_t <em>key_len</em>, <em class="property">const</em> MemoryRegion&lt;byte&gt; &amp;<em>secret</em>, <em class="property">const</em> byte *<em>salt</em>, size_t <em>salt_len</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv3NK3KDF10derive_keyE6size_tRK12MemoryRegionI4byteEPK4byte6size_t" title="Permalink to this definition">¶</a><br /></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv3NK3KDF10derive_keyE6size_tPK4byte6size_tRKNSt6stringE">
<span id="_CPPv2NK3KDF10derive_keyE6size_tPK4byte6size_tRKNSt6stringE"></span><span id="KDF::derive_key__s.byteCP.s.ssCRC"></span>SecureVector&lt;byte&gt; <code class="descname">derive_key</code><span class="sig-paren">(</span>size_t <em>key_len</em>, <em class="property">const</em> byte *<em>secret</em>, size_t <em>secret_len</em>, <em class="property">const</em> std::string &amp;<em>salt</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv3NK3KDF10derive_keyE6size_tPK4byte6size_tRKNSt6stringE" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>All variations on the same theme. Deterministically creates a
uniform random value from <em>secret</em> and <em>salt</em>. Typically <em>salt</em> is
a lable or identifier, such as a session id.</p>
</dd></dl>

</dd></dl>

<p>You can create a <a class="reference internal" href="#_CPPv33KDF" title="KDF"><code class="xref cpp cpp-class docutils literal notranslate"><span class="pre">KDF</span></code></a> using</p>
<dl class="function">
<dt id="_CPPv37get_kdfRKNSt6stringE">
<span id="_CPPv27get_kdfRKNSt6stringE"></span><span id="get_kdf__ssCR"></span><a class="reference internal" href="#_CPPv33KDF" title="KDF">KDF</a> *<code class="descname">get_kdf</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>algo_spec</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv37get_kdfRKNSt6stringE" title="Permalink to this definition">¶</a><br /></dt>
<dd></dd></dl>

</div>


          </div>
        </div>
      </div>
        </div>
        <div class="sidebar">
          <h3>Table of Contents</h3>
          <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Welcome</a></li>
<li class="toctree-l1"><a class="reference internal" href="reading.html">Recommended Reading</a></li>
<li class="toctree-l1"><a class="reference internal" href="building.html">Building The Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="firststep.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="filters.html">Information Flow: Pipes and Filters</a></li>
<li class="toctree-l1"><a class="reference internal" href="pubkey.html">Public Key Cryptography</a></li>
<li class="toctree-l1"><a class="reference internal" href="x509.html">Certificate Handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="ssl.html">SSL and TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigint.html">BigInt</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowlevel.html">The Low-Level Interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="secmem.html">Secure Memory Containers</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Key Derivation Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="pbkdf.html">PBKDF Algorithms</a></li>
<li class="toctree-l1"><a class="reference internal" href="passhash.html">Password Hashing</a></li>
<li class="toctree-l1"><a class="reference internal" href="rng.html">Random Number Generators</a></li>
<li class="toctree-l1"><a class="reference internal" href="fpe.html">Format Preserving Encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="python.html">Python Binding</a></li>
</ul>

          <div role="search">
            <h3 style="margin-top: 1.5em;">Search</h3>
            <form class="search" action="search.html" method="get">
                <input type="text" name="q" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
            </form>
          </div>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

    <div class="footer-wrapper">
      <div class="footer">
        <div class="left">
          <div role="navigation" aria-label="related navigaton">
            <a href="secmem.html" title="Secure Memory Containers"
              accesskey="P">previous</a> |
            <a href="pbkdf.html" title="PBKDF Algorithms"
              accesskey="N">next</a> |
            <a href="genindex.html" title="General Index"
              accesskey="I">index</a>
          </div>
          <div role="note" aria-label="source link">
              <br/>
              <a href="_sources/kdf.txt"
                rel="nofollow">Show Source</a>
          </div>
        </div>

        <div class="right">
          
    <div class="footer" role="contentinfo">
        &#169; Copyright 2000-2011, Jack Lloyd.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.3.
    </div>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

  </body>
</html>