summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorLegrandin <gooksankoo@hoiptorrow.mailexpire.com>2011-01-17 21:17:19 +0100
committerLegrandin <gooksankoo@hoiptorrow.mailexpire.com>2011-01-18 23:39:32 +0100
commitcdc8867904f56d6bc3f98bd84d911afc43c4e075 (patch)
treec26f610eae0272e28c1c6c129c85ca0f3a8540ba /Doc
parent1221bebb3eb2eb1b6e075cf13c0fb4f550404134 (diff)
downloadpycrypto-cdc8867904f56d6bc3f98bd84d911afc43c4e075.tar.gz
Allow RSA to be generated with an arbitary public exponent e.
Small fix to importKey documentation (ASN.1 structure names were incorrect for public keys). Factors of an RSA private key are computed from private exponent d (both slowmath and fastmath).
Diffstat (limited to 'Doc')
-rw-r--r--Doc/pycrypt.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/pycrypt.rst b/Doc/pycrypt.rst
index 32f5d00..3abcd06 100644
--- a/Doc/pycrypt.rst
+++ b/Doc/pycrypt.rst
@@ -663,7 +663,7 @@ Constructs a key object from a tuple of data. This is
algorithm-specific; look at the source code for the details. (To be
documented later.)
-**generate(size, randfunc, progress_func=None)**:
+**generate(size, randfunc, progress_func=None, e=65537)**:
Generate a fresh public/private key pair. ``size`` is a
algorithm-dependent size parameter, usually measured in bits; the
larger it is, the more difficult it will be to break the key. Safe
@@ -683,6 +683,12 @@ string containing the key parameter currently being generated; it's
useful for interactive applications where a user is waiting for a key
to be generated.
+``e`` is the public RSA exponent, and must be an odd positive integer.
+It is typically a small number with very few ones in its binary representation.
+The default value 65537 (=0b10000000000000001) is a safe choice: other
+common values are 5, 7, 17, and 257. Exponent 3 is also widely used,
+but it requires very special care when padding the message.
+
If you want to interface with some other program, you will have to know
the details of the algorithm being used; this isn't a big loss. If you
don't care about working with non-Python software, simply use the