summaryrefslogtreecommitdiff
path: root/old/api/2.5/Crypto-module.html
blob: eaedc7e3f2418d86fe6e8f1d05fdbd65b595d76d (plain)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Crypto</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a href="http://www.pycrypto.org/">PyCrypto.org</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;Crypto
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="Crypto-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== PACKAGE DESCRIPTION ==================== -->
<h1 class="epydoc">Package Crypto</h1><p class="nomargin-top"></p>
<p>Python Cryptography Toolkit</p>
<p>A collection of cryptographic modules implementing various algorithms
and protocols.</p>
<p>Subpackages:</p>
<dl class="rst-docutils">
<dt>Crypto.Cipher</dt>
<dd>Secret-key (AES, DES, ARC4) and public-key encryption (RSA PKCS#1) algorithms</dd>
<dt>Crypto.Hash</dt>
<dd>Hashing algorithms (MD5, SHA, HMAC)</dd>
<dt>Crypto.Protocol</dt>
<dd>Cryptographic protocols (Chaffing, all-or-nothing transform, key derivation
functions). This package does not contain any network protocols.</dd>
<dt>Crypto.PublicKey</dt>
<dd>Public-key encryption and signature algorithms (RSA, DSA)</dd>
<dt>Crypto.Signature</dt>
<dd>Public-key signature algorithms (RSA PKCS#1)</dd>
<dt>Crypto.Util</dt>
<dd>Various useful modules and functions (long-to-string conversion, random number
generation, number theoretic functions)</dd>
</dl>

<hr />
<div class="fields">      <p><strong>Version:</strong>
        2.5
      </p>
</div><!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Submodules</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Submodules"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr><td class="summary">
  <ul class="nomargin">
    <li> <strong class="uidlink"><a href="Crypto.Cipher-module.html">Crypto.Cipher</a></strong>: <em class="summary">Symmetric- and asymmetric-key encryption algorithms.</em>
    <ul>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.AES-module.html">Crypto.Cipher.AES</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.ARC2-module.html">Crypto.Cipher.ARC2</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.ARC4-module.html">Crypto.Cipher.ARC4</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.Blowfish-module.html">Crypto.Cipher.Blowfish</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.CAST-module.html">Crypto.Cipher.CAST</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.DES-module.html">Crypto.Cipher.DES</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.DES3-module.html">Crypto.Cipher.DES3</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.PKCS1_OAEP-module.html">Crypto.Cipher.PKCS1_OAEP</a></strong>: <em class="summary">RSA encryption protocol according to PKCS#1 OAEP</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.PKCS1_v1_5-module.html">Crypto.Cipher.PKCS1_v1_5</a></strong>: <em class="summary">RSA encryption protocol according to PKCS#1 v1.5</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Cipher.XOR-module.html">Crypto.Cipher.XOR</a></strong>    </li>
    </ul>
    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash-module.html">Crypto.Hash</a></strong>: <em class="summary">Hashing algorithms</em>
    <ul>
    <li> <strong class="uidlink"><a href="Crypto.Hash.HMAC-module.html">Crypto.Hash.HMAC</a></strong>: <em class="summary">HMAC (Keyed-Hashing for Message Authentication) Python module.</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.MD2-module.html">Crypto.Hash.MD2</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.MD4-module.html">Crypto.Hash.MD4</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.MD5-module.html">Crypto.Hash.MD5</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.RIPEMD-module.html">Crypto.Hash.RIPEMD</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.SHA-module.html">Crypto.Hash.SHA</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.SHA224-module.html">Crypto.Hash.SHA224</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.SHA256-module.html">Crypto.Hash.SHA256</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.SHA384-module.html">Crypto.Hash.SHA384</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Hash.SHA512-module.html">Crypto.Hash.SHA512</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Hash._MD2-module.html">Crypto.Hash._MD2</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Hash._MD4-module.html">Crypto.Hash._MD4</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Hash._RIPEMD160-module.html">Crypto.Hash._RIPEMD160</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Hash._SHA224-module.html">Crypto.Hash._SHA224</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Hash._SHA256-module.html">Crypto.Hash._SHA256</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Hash._SHA384-module.html">Crypto.Hash._SHA384</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Hash._SHA512-module.html">Crypto.Hash._SHA512</a></strong>    </li>
    </ul>
    </li>
    <li> <strong class="uidlink"><a href="Crypto.Protocol-module.html">Crypto.Protocol</a></strong>: <em class="summary">Cryptographic protocols</em>
    <ul>
    <li> <strong class="uidlink"><a href="Crypto.Protocol.AllOrNothing-module.html">Crypto.Protocol.AllOrNothing</a></strong>: <em class="summary">This file implements all-or-nothing package transformations.</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Protocol.Chaffing-module.html">Crypto.Protocol.Chaffing</a></strong>: <em class="summary">This file implements the chaffing algorithm.</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Protocol.KDF-module.html">Crypto.Protocol.KDF</a></strong>: <em class="summary">This file contains a collection of standard key derivation functions.</em>    </li>
    </ul>
    </li>
    <li> <strong class="uidlink"><a href="Crypto.PublicKey-module.html">Crypto.PublicKey</a></strong>: <em class="summary">Public-key encryption and signature algorithms.</em>
    <ul>
    <li> <strong class="uidlink"><a href="Crypto.PublicKey.DSA-module.html">Crypto.PublicKey.DSA</a></strong>: <em class="summary">DSA public-key signature algorithm.</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.PublicKey.ElGamal-module.html">Crypto.PublicKey.ElGamal</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.PublicKey.RSA-module.html">Crypto.PublicKey.RSA</a></strong>: <em class="summary">RSA public-key cryptography algorithm.</em>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.PublicKey._DSA-module.html">Crypto.PublicKey._DSA</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.PublicKey._RSA-module.html">Crypto.PublicKey._RSA</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.PublicKey._fastmath-module.html" onclick="show_private();">Crypto.PublicKey._fastmath</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.PublicKey._slowmath-module.html">Crypto.PublicKey._slowmath</a></strong>: <em class="summary">Pure Python implementation of the RSA-related portions of Crypto.PublicKey._fastmath.</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.PublicKey.pubkey-module.html">Crypto.PublicKey.pubkey</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.PublicKey.qNEW-module.html">Crypto.PublicKey.qNEW</a></strong>    </li>
    </ul>
    </li>
    <li> <strong class="uidlink"><a href="Crypto.Random-module.html">Crypto.Random</a></strong>
    <ul>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Random.Fortuna-module.html" onclick="show_private();">Crypto.Random.Fortuna</a></strong>
    <ul class="private">
    <li> <strong class="uidlink"><a href="Crypto.Random.Fortuna.FortunaAccumulator-module.html">Crypto.Random.Fortuna.FortunaAccumulator</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Random.Fortuna.FortunaGenerator-module.html">Crypto.Random.Fortuna.FortunaGenerator</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Random.Fortuna.SHAd256-module.html">Crypto.Random.Fortuna.SHAd256</a></strong>: <em class="summary">SHA_d-256 hash function implementation.</em>    </li>
    </ul>
    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Random.OSRNG-module.html" onclick="show_private();">Crypto.Random.OSRNG</a></strong>: <em class="summary">Provides a platform-independent interface to the random number generators
supplied by various operating systems.</em>
    <ul class="private">
    <li> <strong class="uidlink"><a href="Crypto.Random.OSRNG.fallback-module.html">Crypto.Random.OSRNG.fallback</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Random.OSRNG.nt-module.html">Crypto.Random.OSRNG.nt</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Random.OSRNG.posix-module.html">Crypto.Random.OSRNG.posix</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Random.OSRNG.rng_base-module.html">Crypto.Random.OSRNG.rng_base</a></strong>    </li>
    </ul>
    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Random._UserFriendlyRNG-module.html" onclick="show_private();">Crypto.Random._UserFriendlyRNG</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Random.random-module.html">Crypto.Random.random</a></strong>: <em class="summary">A cryptographically strong version of Python's standard &quot;random&quot; module.</em>    </li>
    </ul>
    </li>
    <li> <strong class="uidlink"><a href="Crypto.Signature-module.html">Crypto.Signature</a></strong>: <em class="summary">Digital signature protocols</em>
    <ul>
    <li> <strong class="uidlink"><a href="Crypto.Signature.PKCS1_PSS-module.html">Crypto.Signature.PKCS1_PSS</a></strong>: <em class="summary">RSA digital signature protocol with appendix according to PKCS#1 PSS.</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Signature.PKCS1_v1_5-module.html">Crypto.Signature.PKCS1_v1_5</a></strong>: <em class="summary">RSA digital signature protocol according to PKCS#1 v1.5</em>    </li>
    </ul>
    </li>
    <li> <strong class="uidlink"><a href="Crypto.Util-module.html">Crypto.Util</a></strong>: <em class="summary">Miscellaneous modules</em>
    <ul>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Util.Counter-module.html" onclick="show_private();">Crypto.Util.Counter</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Util.RFC1751-module.html">Crypto.Util.RFC1751</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Util._counter-module.html" onclick="show_private();">Crypto.Util._counter</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Util._number_new-module.html" onclick="show_private();">Crypto.Util._number_new</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Util.asn1-module.html">Crypto.Util.asn1</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Util.number-module.html">Crypto.Util.number</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Util.py21compat-module.html">Crypto.Util.py21compat</a></strong>: <em class="summary">Compatibility code for Python 2.1</em>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Util.py3compat-module.html" onclick="show_private();">Crypto.Util.py3compat</a></strong>: <em class="summary">Compatibility code for handling string/bytes changes from Python 2.x to Py3k</em>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Util.randpool-module.html">Crypto.Util.randpool</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Util.strxor-module.html">Crypto.Util.strxor</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Crypto.Util.winrandom-module.html">Crypto.Util.winrandom</a></strong>    </li>
    <li class="private"> <strong class="uidlink"><a href="Crypto.Util.wrapper-module.html" onclick="show_private();">Crypto.Util.wrapper</a></strong>    </li>
    </ul>
    </li>
    <li> <strong class="uidlink"><a href="Crypto.pct_warnings-module.html">Crypto.pct_warnings</a></strong>    </li>
  </ul></td></tr>
</table>

<br />
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="None">None</code>
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__revision__"></a><span class="summary-name">__revision__</span> = <code title="'$Id$'"><code class="variable-quote">'</code><code class="variable-string">$Id$</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="version_info"></a><span class="summary-name">version_info</span> = <code title="(2, 5, 0, 'final', 0)"><code class="variable-group">(</code>2<code class="variable-op">, </code>5<code class="variable-op">, </code>0<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">final</code><code class="variable-quote">'</code><code class="variable-op">, </code>0<code class="variable-group">)</code></code>
    </td>
  </tr>
</table>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a href="http://www.pycrypto.org/">PyCrypto.org</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Fri Jan 13 12:36:10 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>