diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-02-05 16:01:20 +0100 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-02-05 16:01:20 +0100 |
commit | 3934ab4f16becf439033610b6986a796ab327f72 (patch) | |
tree | 5d495db0e4d52d22896af0ba704c4ce11d2cbaed /doc | |
parent | 282069092d41c67fbda10cb5ffa06a58cd9c5baf (diff) | |
download | rsa-git-3934ab4f16becf439033610b6986a796ab327f72.tar.gz |
Updated documentation, mostly http -> https changes
Also:
- changed http to https in the code
- changed header underlines in the documentation to match the header length
Diffstat (limited to 'doc')
-rw-r--r-- | doc/compatibility.rst | 6 | ||||
-rw-r--r-- | doc/index.rst | 8 | ||||
-rw-r--r-- | doc/installation.rst | 35 | ||||
-rw-r--r-- | doc/intro.rst | 4 | ||||
-rw-r--r-- | doc/licence.rst | 4 | ||||
-rw-r--r-- | doc/reference.rst | 16 | ||||
-rw-r--r-- | doc/upgrading.rst | 4 | ||||
-rw-r--r-- | doc/usage.rst | 20 |
8 files changed, 45 insertions, 52 deletions
diff --git a/doc/compatibility.rst b/doc/compatibility.rst index e6b59a3..aedfcb6 100644 --- a/doc/compatibility.rst +++ b/doc/compatibility.rst @@ -1,5 +1,5 @@ Compatibility with standards -================================================== +============================ .. index:: OpenSSL .. index:: compatibility @@ -30,7 +30,7 @@ Public keys: .. _openssl: Interoperability with OpenSSL --------------------------------------------------- +----------------------------- You can create a 512-bit RSA key in OpenSSL as follows:: @@ -50,7 +50,7 @@ Encryption and decryption is also compatible:: hello there Interoperability with PKCS#8 --------------------------------------------------- +---------------------------- The standard PKCS#8 is widely used, and more complex than the PKCS#1 v1.5 supported by Python-RSA. In order to extract a key from the diff --git a/doc/index.rst b/doc/index.rst index c7600a0..a0a1573 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -11,15 +11,15 @@ encryption and decryption, signing and verifying signatures, and key generation according to PKCS#1 version 1.5. If you have the time and skill to improve the implementation, by all -means be my guest. The best way is to clone the `Mercurial +means be my guest. The best way is to clone the `Git repository`_ and send me a merge request when you've got something worth merging. -.. _`Mercurial repository`: https://bitbucket.org/sybren/python-rsa +.. _`Git repository`: https://github.com/sybrenstuvel/python-rsa Security notice --------------------------------------------------- +--------------- This RSA implementation has seen the eyes of a security expert, and it uses an industry standard random padding method. However, there are @@ -34,7 +34,7 @@ judgement to decide whether this module is secure enough for your application. Contents --------------------------------------------------- +-------- .. toctree:: :maxdepth: 2 diff --git a/doc/installation.rst b/doc/installation.rst index afe093f..578dc86 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -1,5 +1,5 @@ Installation -================================================== +============ Installation can be done in various ways. The simplest form uses pip or easy_install. Either one will work:: @@ -20,16 +20,15 @@ or if that doesn't work:: sudo python setup.py install -The sources are tracked in our `Mercurial repository`_ at -bitbucket.org. It also hosts the `issue tracker`_. +The sources are tracked in our `Git repository`_ at +Github. It also hosts the `issue tracker`_. -.. _`Mercurial repository`: https://bitbucket.org/sybren/python-rsa -.. _`issue tracker`: - https://bitbucket.org/sybren/python-rsa/issues?status=new&status=open +.. _`Git repository`: https://github.com/sybrenstuvel/python-rsa.git +.. _`issue tracker`: https://github.com/sybrenstuvel/python-rsa/issues Dependencies --------------------------------------------------- +------------ Python-RSA has very few dependencies. As a matter of fact, to use it you only need Python itself. Loading and saving keys does require an @@ -38,25 +37,19 @@ described above, you should be ready to go. Development dependencies --------------------------------------------------- +------------------------ In order to start developing on Python-RSA you need a bit more. Use -pip to install the development requirements in a virtual environment -for Python 2.x:: +pip to install the development requirements in a virtual environment:: - virtualenv python-rsa-venv-py2x - . python-rsa-venv-py2x/bin/activate - pip install -r python-rsa/requirements-dev-py2x.txt + virtualenv -p /path/to/your-python-version python-rsa-venv + . python-rsa-venv/bin/activate + pip install -r python-rsa/requirements.txt -or Python 3.x:: - virtualenv python-rsa-venv-py3x - . python-rsa-venv-py3x/bin/activate - pip install -r python-rsa/requirements-dev-py3x.txt +Once these are installed, use Git_ to get a copy of the source:: -Once these are installed, use Mercurial_ to get a copy of the source:: - - hg clone https://bitbucket.org/sybren/python-rsa + hg clone https://github.com/sybrenstuvel/python-rsa.git python setup.py develop -.. _Mercurial: http://hg-scm.com/ +.. _Git: https://git-scm.com/ diff --git a/doc/intro.rst b/doc/intro.rst index 14d0177..e689bde 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -1,5 +1,5 @@ Introduction & history -================================================== +====================== Python-RSA's history starts in 2006. As a student assignment for the University of Amsterdam we wrote a RSA implementation. We chose Python @@ -7,7 +7,7 @@ for various reasons; one of the most important reasons was the `unlimited precision integer`_ support. .. _`unlimited precision integer`: - http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex + https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex It started out as just a module for calculating large primes, and RSA encryption, decryption, signing and verification using those large diff --git a/doc/licence.rst b/doc/licence.rst index 91465a8..bc07dbd 100644 --- a/doc/licence.rst +++ b/doc/licence.rst @@ -1,5 +1,5 @@ Licence -================================================== +======= The source code and documentation are protected under copyright by Sybren A. Stüvel <sybren@stuvel.eu> @@ -8,7 +8,7 @@ The software is licensed under the Apache License, Version 2.0 (the "License"); you may not use the software except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/doc/reference.rst b/doc/reference.rst index ce9c1b9..d1b0b6d 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -1,11 +1,11 @@ Reference -================================================== +========= This is the class and function reference. For more usage information see the :ref:`usage` page. Functions --------------------------------------------------- +--------- .. autofunction:: rsa.encrypt @@ -19,7 +19,7 @@ Functions Classes --------------------------------------------------- +------- .. note:: @@ -38,7 +38,7 @@ Classes :inherited-members: Exceptions --------------------------------------------------- +---------- .. autoclass:: rsa.pkcs1.CryptoError(Exception) @@ -50,7 +50,7 @@ Exceptions .. index:: VARBLOCK (file format) Module: rsa.bigfile --------------------------------------------------- +------------------- .. warning:: @@ -69,7 +69,7 @@ decrypting files that are larger than the RSA key. See .. _VARBLOCK: The VARBLOCK file format -++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++ .. warning:: @@ -95,11 +95,11 @@ The varint-format was taken from Google's Protobuf_, and allows us to efficiently encode an arbitrarily long integer. .. _Protobuf: - http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints + https://code.google.com/apis/protocolbuffers/docs/encoding.html#varints Module: rsa.core --------------------------------------------------- +---------------- At the core of the RSA encryption method lie these functions. They both operate on (arbitrarily long) integers only. They probably aren't diff --git a/doc/upgrading.rst b/doc/upgrading.rst index c21fa4b..0ec18eb 100644 --- a/doc/upgrading.rst +++ b/doc/upgrading.rst @@ -1,5 +1,5 @@ Upgrading from older versions -================================================== +============================= Previous versions of Python-RSA were less secure than the current version. In order to be able to gradually upgrade your software, those @@ -38,7 +38,7 @@ You can either generate a new key with :py:func:`rsa.newkeys`, or use :py:func:`rsa.bigfile.encrypt_bigfile` to encrypt your files. Converting keys --------------------------------------------------- +--------------- Version 3.0 introduced industrial standard RSA keys according to PKCS#1. The old keys were just dictionaries. To convert a key from an diff --git a/doc/usage.rst b/doc/usage.rst index 6e11a35..a3d128d 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -1,7 +1,7 @@ .. _usage: Usage -================================================== +===== This section describes the usage of the Python-RSA module. @@ -25,7 +25,7 @@ after signing. Generating keys --------------------------------------------------- +--------------- You can use the :py:func:`rsa.newkeys` function to create a keypair: @@ -42,7 +42,7 @@ Alternatively you can use :py:meth:`rsa.PrivateKey.load_pkcs1` and Time to generate a key -++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++ Generating a keypair may take a long time, depending on the number of bits required. The number of bits determines the cryptographic @@ -91,7 +91,7 @@ generates a 4096-bit key in 3.5 seconds on the same machine as used above. See :ref:`openssl` for more information. Key size requirements --------------------------------------------------- +--------------------- Python-RSA version 3.0 introduced PKCS#1-style random padding. This means that 11 bytes (88 bits) of your key are no longer usable for @@ -118,7 +118,7 @@ on the used hash method: Encryption and decryption --------------------------------------------------- +------------------------- To encrypt or decrypt a message, use :py:func:`rsa.encrypt` resp. :py:func:`rsa.decrypt`. Let's say that Alice wants to send a message @@ -182,7 +182,7 @@ Altering the encrypted information will *likely* cause a makes cracking the keys easier. Low-level operations -++++++++++++++++++++++++++++++ +++++++++++++++++++++ The core RSA algorithm operates on large integers. These operations are considered low-level and are supported by the @@ -190,7 +190,7 @@ are considered low-level and are supported by the functions. Signing and verification --------------------------------------------------- +------------------------ You can create a detached signature for a message using the :py:func:`rsa.sign` function: @@ -244,7 +244,7 @@ In that case the file is hashed in 1024-byte blocks at the time. .. _bigfiles: Working with big files --------------------------------------------------- +---------------------- RSA can only encrypt messages that are smaller than the key. A couple of bytes are lost on random padding, and the rest is available for the @@ -253,7 +253,7 @@ message (512 bit = 64 bytes, 11 bytes are used for random padding and other stuff). How it usually works -++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ The most common way to use RSA with larger files uses a block cypher like AES or DES3 to encrypt the file with a random key, then encrypt @@ -280,7 +280,7 @@ the encrypted key to the recipient. The complete flow is: encryption for you. Only using Python-RSA: the VARBLOCK format -+++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++ .. warning:: |