36
36
border="0" height="32"
37
37
alt="" width="32"></td>
39
<b class="navlabel">Previous:</b> <a class="sectref" href="revoked.html">3.1.11 Revoked objects</A>
39
<b class="navlabel">Previous:</b> <a class="sectref" href="revoked.html">3.1.12 Revoked objects</A>
40
40
<b class="navlabel">Up:</b> <a class="sectref" href="openssl.html">3 OpenSSL </A>
41
41
<b class="navlabel">Next:</b> <a class="sectref" href="openssl-ssl.html">3.3 SSL </A>
56
56
declares the following:
59
<dl><dt><b><a name='l2h-113'><tt class='function'>add</tt></a></b>(<var>string, entropy</var>)
59
<dl><dt><b><a name='l2h-117'><tt class='function'>add</tt></a></b>(<var>string, entropy</var>)
61
61
Mix bytes from <var>string</var> into the PRNG state. The <var>entropy</var> argument is
62
62
(the lower bound of) an estimate of how much randomness is contained in
63
<var>string</var>, measured in bytes. For more information, see e.g. <a class="rfc" name="rfcref-2269"
63
<var>string</var>, measured in bytes. For more information, see e.g. <a class="rfc" name="rfcref-2324"
64
64
href="http://www.ietf.org/rfc/rfc1750.txt">RFC 1750</a>.
68
<dl><dt><b><a name='l2h-114'><tt class='function'>bytes</tt></a></b>(<var>num_bytes</var>)
68
<dl><dt><b><a name='l2h-118'><tt class='function'>bytes</tt></a></b>(<var>num_bytes</var>)
70
70
Get some random bytes from the PRNG as a string.
86
<dl><dt><b><a name='l2h-116'><tt class='function'>egd</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
86
<dl><dt><b><a name='l2h-120'><tt class='function'>egd</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
88
88
Query the Entropy Gathering Daemon<A NAME="tex2html2"
89
HREF="#foot1204"><SUP>2</SUP></A> on socket <var>path</var> for <var>bytes</var>
89
HREF="#foot1227"><SUP>2</SUP></A> on socket <var>path</var> for <var>bytes</var>
90
90
bytes of random data and and uses <tt class="function">add</tt> to seed the PRNG. The default
91
91
value of <var>bytes</var> is 255.
95
<dl><dt><b><a name='l2h-117'><tt class='function'>load_file</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
95
<dl><dt><b><a name='l2h-121'><tt class='function'>load_file</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
97
97
Read <var>bytes</var> bytes (or all of it, if <var>bytes</var> is negative) of data from
98
98
the file <var>path</var> to seed the PRNG. The default value of <var>bytes</var> is -1.
102
<dl><dt><b><a name='l2h-118'><tt class='function'>screen</tt></a></b>()
102
<dl><dt><b><a name='l2h-122'><tt class='function'>screen</tt></a></b>()
104
104
Add the current contents of the screen to the PRNG state.
105
105
Availability: Windows.
109
<dl><dt><b><a name='l2h-119'><tt class='function'>seed</tt></a></b>(<var>string</var>)
109
<dl><dt><b><a name='l2h-123'><tt class='function'>seed</tt></a></b>(<var>string</var>)
111
111
This is equivalent to calling <tt class="function">add</tt> with <var>entropy</var> as the length
116
<dl><dt><b><a name='l2h-120'><tt class='function'>status</tt></a></b>()
116
<dl><dt><b><a name='l2h-124'><tt class='function'>status</tt></a></b>()
118
118
Returns true if the PRNG has been seeded with enough data, and false otherwise.
122
<dl><dt><b><a name='l2h-121'><tt class='function'>write_file</tt></a></b>(<var>path</var>)
122
<dl><dt><b><a name='l2h-125'><tt class='function'>write_file</tt></a></b>(<var>path</var>)
124
124
Write a number of random bytes (currently 1024) to the file <var>path</var>. This
125
125
file can then be used with <tt class="function">load_file</tt> to seed the PRNG again.
129
<dl><dt><b>exception <a name='l2h-122'><tt class='exception'>Error</tt></a></b>
129
<dl><dt><b>exception <a name='l2h-126'><tt class='exception'>Error</tt></a></b>
131
131
If the current RAND method supports any errors, this is raised when needed.
132
132
The default method does not raise this when the entropy pool is depleted.
143
143
<BR><HR><H4>Footnotes</H4>
145
<DT><A NAME="foot1204">... Daemon</A><A
145
<DT><A NAME="foot1227">... Daemon</A><A
146
146
href="openssl-rand.html#tex2html2"><SUP>2</SUP></A></DT>
148
148
<a class="url" href="http://www.lothar.com/tech/crypto/">http://www.lothar.com/tech/crypto/</a>
173
173
border="0" height="32"
174
174
alt="" width="32"></td>
176
<b class="navlabel">Previous:</b> <a class="sectref" href="revoked.html">3.1.11 Revoked objects</A>
176
<b class="navlabel">Previous:</b> <a class="sectref" href="revoked.html">3.1.12 Revoked objects</A>
177
177
<b class="navlabel">Up:</b> <a class="sectref" href="openssl.html">3 OpenSSL </A>
178
178
<b class="navlabel">Next:</b> <a class="sectref" href="openssl-ssl.html">3.3 SSL </A>