Sybren A. Stüvel | d92b667 | 2011-07-31 17:44:44 +0200 | [diff] [blame] | 1 | Reference |
| 2 | ================================================== |
| 3 | |
| 4 | Functions |
| 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üvel | c1c455d | 2011-08-01 23:04:30 +0200 | [diff] [blame^] | 17 | .. autofunction:: rsa.bigfile.encrypt_bigfile |
| 18 | |
| 19 | .. autofunction:: rsa.bigfile.decrypt_bigfile |
| 20 | |
| 21 | |
Sybren A. Stüvel | d92b667 | 2011-07-31 17:44:44 +0200 | [diff] [blame] | 22 | Classes |
| 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üvel | 1f011e1 | 2011-07-31 19:20:46 +0200 | [diff] [blame] | 33 | Exceptions |
| 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üvel | d92b667 | 2011-07-31 17:44:44 +0200 | [diff] [blame] | 42 | |
Sybren A. Stüvel | c1c455d | 2011-08-01 23:04:30 +0200 | [diff] [blame^] | 43 | .. index:: VARBLOCK (file format) |
| 44 | |
| 45 | The VARBLOCK file format |
| 46 | -------------------------------------------------- |
| 47 | |
| 48 | The VARBLOCK file format allows us to encrypt files that are larger |
| 49 | than the RSA key. The format is as follows; || denotes byte string |
| 50 | concatenation:: |
| 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 | |
| 62 | The varint-format was taken from Google's Protobuf_, and allows us to |
| 63 | efficiently encode an arbitrarily long integer. |
| 64 | |
| 65 | .. _Protobuf: |
| 66 | http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints |
Sybren A. Stüvel | d92b667 | 2011-07-31 17:44:44 +0200 | [diff] [blame] | 67 | |