blob: a1a7d3576510d4c5637b79f79e4d6b2248437246 [file] [log] [blame]
Sybren A. Stüveld92b6672011-07-31 17:44:44 +02001Reference
2==================================================
3
4Functions
5--------------------------------------------------
6
7.. autofunction:: rsa.encrypt
8
9.. autofunction:: rsa.decrypt
10
11.. autofunction:: rsa.sign
12
13.. autofunction:: rsa.verify
14
15.. autofunction:: rsa.newkeys(keysize)
16
Sybren A. Stüvelc1c455d2011-08-01 23:04:30 +020017.. autofunction:: rsa.bigfile.encrypt_bigfile
18
19.. autofunction:: rsa.bigfile.decrypt_bigfile
20
21
Sybren A. Stüveld92b6672011-07-31 17:44:44 +020022Classes
23--------------------------------------------------
24
25.. autoclass:: rsa.PublicKey
26 :members:
27 :inherited-members:
28
29.. autoclass:: rsa.PrivateKey
30 :members:
31 :inherited-members:
32
Sybren A. Stüvel1f011e12011-07-31 19:20:46 +020033Exceptions
34--------------------------------------------------
35
36.. autoclass:: rsa.pkcs1.CryptoError(Exception)
37
38.. autoclass:: rsa.pkcs1.DecryptionError(CryptoError)
39
40.. autoclass:: rsa.pkcs1.VerificationError(CryptoError)
41
Sybren A. Stüveld92b6672011-07-31 17:44:44 +020042
Sybren A. Stüvelc1c455d2011-08-01 23:04:30 +020043.. index:: VARBLOCK (file format)
44
45The VARBLOCK file format
46--------------------------------------------------
47
48The VARBLOCK file format allows us to encrypt files that are larger
49than the RSA key. The format is as follows; || denotes byte string
50concatenation::
51
52 VARBLOCK := VERSION || BLOCK || BLOCK || ...
53
54 VERSION := 1
55
56 BLOCK := LENGTH || DATA
57
58 LENGTH := varint-encoded length of the followng data, in bytes
59
60 DATA := the data to store in the block
61
62The varint-format was taken from Google's Protobuf_, and allows us to
63efficiently encode an arbitrarily long integer.
64
65.. _Protobuf:
66 http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints
Sybren A. Stüveld92b6672011-07-31 17:44:44 +020067