• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Reference
2==================================================
3
4This is the class and function reference. For more usage information
5see the :ref:`usage` page.
6
7Functions
8--------------------------------------------------
9
10.. autofunction:: rsa.encrypt
11
12.. autofunction:: rsa.decrypt
13
14.. autofunction:: rsa.sign
15
16.. autofunction:: rsa.verify
17
18.. autofunction:: rsa.newkeys(keysize)
19
20
21Classes
22--------------------------------------------------
23
24.. autoclass:: rsa.PublicKey
25    :members:
26    :inherited-members:
27
28.. autoclass:: rsa.PrivateKey
29    :members:
30    :inherited-members:
31
32Exceptions
33--------------------------------------------------
34
35.. autoclass:: rsa.pkcs1.CryptoError(Exception)
36
37.. autoclass:: rsa.pkcs1.DecryptionError(CryptoError)
38
39.. autoclass:: rsa.pkcs1.VerificationError(CryptoError)
40
41
42.. index:: VARBLOCK (file format)
43
44Module: rsa.bigfile
45--------------------------------------------------
46
47The :py:mod:`rsa.bigfile` module contains functions for encrypting and
48decrypting files that are larger than the RSA key. See
49:ref:`bigfiles` for more information.
50
51.. autofunction:: rsa.bigfile.encrypt_bigfile
52
53.. autofunction:: rsa.bigfile.decrypt_bigfile
54
55.. _VARBLOCK:
56
57The VARBLOCK file format
58++++++++++++++++++++++++++++++++++++++++++++++++++
59
60The VARBLOCK file format allows us to encrypt files that are larger
61than the RSA key. The format is as follows; || denotes byte string
62concatenation::
63
64 VARBLOCK := VERSION || BLOCK || BLOCK || ...
65
66 VERSION := 1
67
68 BLOCK := LENGTH || DATA
69
70 LENGTH := varint-encoded length of the following data, in bytes
71
72 DATA := the data to store in the block
73
74The varint-format was taken from Google's Protobuf_, and allows us to
75efficiently encode an arbitrarily long integer.
76
77.. _Protobuf:
78    http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints
79
80
81Module: rsa.core
82--------------------------------------------------
83
84At the core of the RSA encryption method lie these functions. They
85both operate on (arbitrarily long) integers only. They probably aren't
86of much use to you, but I wanted to document them anyway as they are
87the core of the entire library.
88
89.. autofunction:: rsa.core.encrypt_int
90
91.. autofunction:: rsa.core.decrypt_int
92
93