/usr/share/doc/libgcrypt11-doc/html/Key-Derivation.html is in libgcrypt11-doc 1.5.3-2ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is for Libgcrypt
(version 1.5.3, 17 December 2013),
which is GNU's library of cryptographic building blocks.
Copyright (C) 2000, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. The text of the license can be found in the
section entitled "GNU General Public License". -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>The Libgcrypt Reference Manual: Key Derivation</title>
<meta name="description" content="The Libgcrypt Reference Manual: Key Derivation">
<meta name="keywords" content="The Libgcrypt Reference Manual: Key Derivation">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="Random-Numbers.html#Random-Numbers" rel="next" title="Random Numbers">
<link href="Working-with-hash-algorithms.html#Working-with-hash-algorithms" rel="prev" title="Working with hash algorithms">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Key-Derivation"></a>
<div class="header">
<p>
Next: <a href="Random-Numbers.html#Random-Numbers" accesskey="n" rel="next">Random Numbers</a>, Previous: <a href="Hashing.html#Hashing" accesskey="p" rel="prev">Hashing</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Key-Derivation-1"></a>
<h2 class="chapter">8 Key Derivation</h2>
<p><acronym>Libgcypt</acronym> provides a general purpose function to derive keys
from strings.
</p>
<dl>
<dt><a name="index-gcry_005fkdf_005fderive"></a>Function: <em>gpg_error_t</em> <strong>gcry_kdf_derive</strong> <em>( const void *<var>passphrase</var><!-- /@w -->, <span class="nolinebreak">size_t</span> <var>passphraselen</var><!-- /@w -->, int <var>algo</var><!-- /@w -->, int <var>subalgo</var><!-- /@w -->, const void *<var>salt</var><!-- /@w -->, <span class="nolinebreak">size_t</span> <var>saltlen</var><!-- /@w -->, unsigned long <var>iterations</var><!-- /@w -->, <span class="nolinebreak">size_t</span> <var>keysize</var><!-- /@w -->, void *<var>keybuffer</var><!-- /@w --> )</em></dt>
<dd>
<p>Derive a key from a passphrase. <var>keysize</var> gives the requested
size of the keys in octets. <var>keybuffer</var> is a caller provided
buffer filled on success with the derived key. The input passphrase
is taken from <var>passphrase</var> which is an arbitrary memory buffer of
<var>passphraselen</var> octets. <var>algo</var> specifies the KDF algorithm to
use; see below. <var>subalgo</var> specifies an algorithm used internally
by the KDF algorithms; this is usually a hash algorithm but certain
KDF algorithms may use it differently. <var>salt</var> is a salt of length
<var>saltlen</var> octets, as needed by most KDF algorithms.
<var>iterations</var> is a positive integer parameter to most KDFs.
</p>
<p>On success 0 is returned; on failure an error code.
</p>
<p>Currently supported KDFs (parameter <var>algo</var>):
</p>
<dl compact="compact">
<dt><code>GCRY_KDF_SIMPLE_S2K</code></dt>
<dd><p>The OpenPGP simple S2K algorithm (cf. RFC4880). Its use is strongly
deprecated. <var>salt</var> and <var>iterations</var> are not needed and may be
passed as <code>NULL</code>/<code>0</code>.
</p>
</dd>
<dt><code>GCRY_KDF_SALTED_S2K</code></dt>
<dd><p>The OpenPGP salted S2K algorithm (cf. RFC4880). Usually not used.
<var>iterations</var> is not needed and may be passed as <code>0</code>. <var>saltlen</var>
must be given as 8.
</p>
</dd>
<dt><code>GCRY_KDF_ITERSALTED_S2K</code></dt>
<dd><p>The OpenPGP iterated+salted S2K algorithm (cf. RFC4880). This is the
default for most OpenPGP applications. <var>saltlen</var> must be given as
8. Note that OpenPGP defines a special encoding of the
<var>iterations</var>; however this function takes the plain decoded
iteration count.
</p>
</dd>
<dt><code>GCRY_KDF_PBKDF2</code></dt>
<dd><p>The PKCS#5 Passphrase Based Key Derivation Function number 2.
</p>
</dd>
</dl>
</dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Random-Numbers.html#Random-Numbers" accesskey="n" rel="next">Random Numbers</a>, Previous: <a href="Hashing.html#Hashing" accesskey="p" rel="prev">Hashing</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|