~rick-fdd/pyopenssl/rand_bytes

« back to all changes in this revision

Viewing changes to doc/html/openssl-rand.html

  • Committer: Jean-Paul Calderone
  • Date: 2009-03-07 14:10:30 UTC
  • Revision ID: exarkun@boson-20090307141030-r4mro2ghsvdfh9xt
RegenerateĀ docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
declares the following:
57
57
 
58
58
<P>
59
 
<dl><dt><b><a name='l2h-89'><tt class='function'>add</tt></a></b>(<var>string, entropy</var>)
 
59
<dl><dt><b><a name='l2h-92'><tt class='function'>add</tt></a></b>(<var>string, entropy</var>)
60
60
<dd>
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-1840"
 
63
<var>string</var>, measured in bytes. For more information, see e.g. <a class="rfc" name="rfcref-1878"
64
64
href="http://www.ietf.org/rfc/rfc1750.txt">RFC 1750</a>.
65
65
</dl>
66
66
 
67
67
<P>
68
 
<dl><dt><b><a name='l2h-90'><tt class='function'>egd</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
 
68
<dl><dt><b><a name='l2h-93'><tt class='function'>egd</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
69
69
<dd>
70
70
Query the Entropy Gathering Daemon<A NAME="tex2html2"
71
 
  HREF="#foot945"><SUP>2</SUP></A> on socket <var>path</var> for <var>bytes</var>
 
71
  HREF="#foot972"><SUP>2</SUP></A> on socket <var>path</var> for <var>bytes</var>
72
72
bytes of random data and and uses <tt class="function">add</tt> to seed the PRNG. The default
73
73
value of <var>bytes</var> is 255.
74
74
</dl>
75
75
 
76
76
<P>
77
 
<dl><dt><b><a name='l2h-91'><tt class='function'>load_file</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
 
77
<dl><dt><b><a name='l2h-94'><tt class='function'>load_file</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
78
78
<dd>
79
79
Read <var>bytes</var> bytes (or all of it, if <var>bytes</var> is negative) of data from
80
80
the file <var>path</var> to seed the PRNG. The default value of <var>bytes</var> is -1.
81
81
</dl>
82
82
 
83
83
<P>
84
 
<dl><dt><b><a name='l2h-92'><tt class='function'>screen</tt></a></b>()
 
84
<dl><dt><b><a name='l2h-95'><tt class='function'>screen</tt></a></b>()
85
85
<dd>
86
86
Add the current contents of the screen to the PRNG state.
87
87
Availability: Windows.
88
88
</dl>
89
89
 
90
90
<P>
91
 
<dl><dt><b><a name='l2h-93'><tt class='function'>seed</tt></a></b>(<var>string</var>)
 
91
<dl><dt><b><a name='l2h-96'><tt class='function'>seed</tt></a></b>(<var>string</var>)
92
92
<dd>
93
93
This is equivalent to calling <tt class="function">add</tt> with <var>entropy</var> as the length
94
94
of the string.
95
95
</dl>
96
96
 
97
97
<P>
98
 
<dl><dt><b><a name='l2h-94'><tt class='function'>status</tt></a></b>()
 
98
<dl><dt><b><a name='l2h-97'><tt class='function'>status</tt></a></b>()
99
99
<dd>
100
100
Returns true if the PRNG has been seeded with enough data, and false otherwise.
101
101
</dl>
102
102
 
103
103
<P>
104
 
<dl><dt><b><a name='l2h-95'><tt class='function'>write_file</tt></a></b>(<var>path</var>)
 
104
<dl><dt><b><a name='l2h-98'><tt class='function'>write_file</tt></a></b>(<var>path</var>)
105
105
<dd>
106
106
Write a number of random bytes (currently 1024) to the file <var>path</var>. This
107
107
file can then be used with <tt class="function">load_file</tt> to seed the PRNG again.
110
110
<P>
111
111
<BR><HR><H4>Footnotes</H4>
112
112
<DL>
113
 
<DT><A NAME="foot945">... Daemon</A><A
 
113
<DT><A NAME="foot972">... Daemon</A><A
114
114
 href="openssl-rand.html#tex2html2"><SUP>2</SUP></A></DT>
115
115
<DD>See
116
116
<a class="url" href="http://www.lothar.com/tech/crypto/">http://www.lothar.com/tech/crypto/</a>