Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix exception causes all over the codebase | Ram Rachum | 2021-02-24 | 1 | -3/+3 |
| | | | | | | | | | | | | | | | | | | | | | | The mistake is this: In some parts of the code, an exception is being caught and replaced with a more user-friendly error. In these cases the syntax `raise new_error from old_error` needs to be used. Python's exception chaining means it shows not only the traceback of the current exception, but that of the original exception (and possibly more.) This is regardless of `raise from`. The usage of `raise from` tells Python to put a more accurate message between the tracebacks. Instead of this: During handling of the above exception, another exception occurred: You'll get this: The above exception was the direct cause of the following exception: The first is inaccurate, because it signifies a bug in the exception-handling code itself, which is a separate situation than wrapping an exception. | ||||
* | Fix #173: unpickling doesn't restore full object | Bu Sun Kim | 2021-02-24 | 1 | -0/+2 |
| | | | | | When a `PrivateKey` or `PublicKey` is unpickled `AbstractKey.__init__()` should be called so `self.mutex` and `self.blindfac` are created. | ||||
* | Fix threading issue introduced in 4.7 | Sybren A. Stüvel | 2021-02-15 | 1 | -30/+44 |
| | | | | | | | | | Computing the blinding factor and its inverse was done in a thread-unsafe manner. Locking the computation & update of the blinding factors, and passing these around in frame- and stack-bound data, solves this. This fixes part of the issues reported in sybrenstuvel/python-rsa#173, but there is more going on in that particular report. | ||||
* | Fix #162: Blinding uses slow algorithm | Sybren A. Stüvel | 2020-11-15 | 1 | -20/+32 |
| | | | | | | | | | Store blinding factor + its inverse, so that they can be reused & updated on every blinding operation. This avoids expensive computations. The reuse of the previous blinding factor is done via squaring (mod n), as per section 9 of 'A Timing Attack against RSA with the Chinese Remainder Theorem' by Werner Schindler, https://tls.mbed.org/public/WSchindler-RSA_Timing_Attack.pdf | ||||
* | Add more type hints | Andrey Semakin | 2020-06-03 | 1 | -12/+16 |
| | |||||
* | Drop character encoding markers for Python 2.x | Andrey Semakin | 2020-06-03 | 1 | -2/+0 |
| | |||||
* | Choose blinding factor relatively prime to N | Sybren A. Stüvel | 2020-04-14 | 1 | -2/+9 |
| | | | | This is a requirement for RSA blinding, but wasn't implemented yet. | ||||
* | Added flake8 as development dependency and fixed reported issues | Sybren A. Stüvel | 2019-08-04 | 1 | -1/+2 |
| | |||||
* | Added type annotations + some fixes to get them correct | Sybren A. Stüvel | 2019-08-04 | 1 | -46/+49 |
| | | | | | | One functional change: `CryptoOperation.read_infile()` now reads bytes from `sys.stdin` instead of text. This is necessary to be consistent with the rest of the code, which all deals with bytes. | ||||
* | Removed compatibility code for Python 2.7 and 3.4 | Sybren A. Stüvel | 2019-08-04 | 1 | -1/+0 |
| | |||||
* | speedup | yjqiang | 2018-09-16 | 1 | -1/+1 |
| | | | "if A and B" if mostly A is True then we should judge B at first | ||||
* | Use iterative zip in Python 2 (#85) | Michael Manganiello | 2017-01-17 | 1 | -1/+1 |
| | | | Good catch, thanks! | ||||
* | Remove custom PrivateKey exponents/coefficient (#71) | Michael Manganiello | 2017-01-05 | 1 | -32/+25 |
| | | | Thanks for the improvements! | ||||
* | Fixes a typo in docstrings (#83) | Alexandr | 2016-11-08 | 1 | -2/+2 |
| | |||||
* | Drop byte_literal in favour of b'' | adamantike | 2016-05-08 | 1 | -3/+3 |
| | |||||
* | xrange compatibility optimization for Python 2 (#69) | Michael Manganiello | 2016-05-08 | 1 | -1/+1 |
| | |||||
* | Implemented __hash__ function for key objects. | Sybren A. Stüvel | 2016-03-29 | 1 | -0/+6 |
| | | | | | | Overriding __eq__ blocks inheritance of __hash__ in Python 3. Fixes issue #55 | ||||
* | Introduced NotRelativePrimeError exception. | Sybren A. Stüvel | 2016-03-29 | 1 | -3/+5 |
| | | | | | | This makes catching exceptions slightly stronger, as it is now possible to check for this specific exception. Furthermore, information about the not-prime numbers is included in the exception object. | ||||
* | PEP8 formatting | Sybren A. Stüvel | 2016-03-29 | 1 | -9/+9 |
| | |||||
* | More CLI tests & clearer bytes stuff | Sybren A. Stüvel | 2016-03-17 | 1 | -7/+58 |
| | | | | | Ensuring that bytes are written correctly on all supported Python versions, including when writing to stdout. | ||||
* | Updated documentation, mostly http -> https changes | Sybren A. Stüvel | 2016-02-05 | 1 | -1/+1 |
| | | | | | | Also: - changed http to https in the code - changed header underlines in the documentation to match the header length | ||||
* | Fixed PEP8 style issues | Sybren A. Stüvel | 2016-01-27 | 1 | -3/+3 |
| | |||||
* | Fix #18: Add an 'exponent' argument to key.newkeys() | Sybren A. Stüvel | 2016-01-27 | 1 | -15/+41 |
| | | | | | | | | Adds the possibility to create a new key using a custom exponent. Mostly for compatibility. Also removed the unused parameter nbits from calculate_keys(). I added a new function calculate_keys_custom_exponent() so that people still passing a value to nbits don't accidentally use it as the exponent. | ||||
* | Removed unused import | Sybren A. Stüvel | 2016-01-27 | 1 | -1/+1 |
| | |||||
* | Removed code duplication | Sybren A. Stüvel | 2016-01-27 | 1 | -11/+13 |
| | |||||
* | Fixed bug where PrivateKey.exp2 wasn't correctly processed in the constructor. | Sybren A. Stüvel | 2016-01-27 | 1 | -5/+5 |
| | | | | | If exp1 was not given and exp2 was, it would still recompute exp2 instead of using the passed value. | ||||
* | Fix #12 Allow pickling of keys. | Sybren A. Stüvel | 2016-01-22 | 1 | -0/+24 |
| | | | | | Pickling is now possible, with the added note that one should never unpickle from an untrusted or unauthenticated source. | ||||
* | Removed doctest for blinding, as it is not suitable as an example for end users. | Sybren A. Stüvel | 2016-01-22 | 1 | -8/+0 |
| | |||||
* | Another pass at blinding. | Sybren A. Stüvel | 2016-01-22 | 1 | -17/+18 |
| | |||||
* | Use random number when blinding, and also blind when verifying signatures. | Sybren A. Stüvel | 2016-01-22 | 1 | -36/+72 |
| | |||||
* | Fixed some docstrings to use Sphinx-compatible notation | Sybren A. Stüvel | 2016-01-22 | 1 | -14/+15 |
| | |||||
* | Fix #19: Implemented blinding when decrypting. | Sybren A. Stüvel | 2016-01-22 | 1 | -0/+36 |
| | | | | | This prevents side-channel (such as timing) attacks, see: https://en.wikipedia.org/wiki/Blinding_%28cryptography%29 | ||||
* | Fix #30, removed use of deprecated `base64.decodestring` from docstrings | Sybren A. Stüvel | 2016-01-22 | 1 | -2/+2 |
| | |||||
* | Big refactor to become more PEP8 compliant. | Sybren A. Stüvel | 2016-01-22 | 1 | -84/+83 |
| | | | | | Mostly focused on docstrings (''' → """), indentation, empty lines, and superfluous parenthesis. | ||||
* | Primes regeneration in RSA keys generation | Michael Manganiello | 2016-01-21 | 1 | -3/+11 |
| | |||||
* | Corrected accurate mode of 'newkeys' function | Michael Manganiello | 2016-01-21 | 1 | -2/+4 |
| | |||||
* | Explicitly cast ASN.1 integer type to Python int | Sybren A. Stüvel | 2012-10-12 | 1 | -1/+1 |
| | |||||
* | Added support for loading public keys from OpenSSL | Sybren A. Stüvel | 2012-10-11 | 1 | -18/+49 |
| | |||||
* | Reverts docstring quoting syntax. | Yesudeep Mangalapilly | 2011-08-24 | 1 | -37/+37 |
| | |||||
* | Parellelized testing. Caught a lot of bugs. | Yesudeep Mangalapilly | 2011-08-16 | 1 | -31/+31 |
| | |||||
* | Porting to Python 3 complete. All tests except pyasn1 stuff pass. | Yesudeep Mangalapilly | 2011-08-11 | 1 | -2/+3 |
| | |||||
* | Tests are now functional (only running without syntax errors) on Python 3 too. | Yesudeep Mangalapilly | 2011-08-11 | 1 | -5/+5 |
| | |||||
* | Added basic Chinese Remainder theorem implementation, not yet used. | Sybren A. Stüvel | 2011-08-10 | 1 | -30/+5 |
| | |||||
* | Added parallel.py module and ability to use multiprocessing when generating keys | Sybren A. Stüvel | 2011-08-10 | 1 | -19/+41 |
| | |||||
* | Removed unused import of abc module, updated changelog | Sybren A. Stüvel | 2011-08-07 | 1 | -1/+0 |
| | |||||
* | fixed doctests | Sybren A. Stüvel | 2011-07-31 | 1 | -6/+6 |
| | |||||
* | More documentation | Sybren A. Stüvel | 2011-07-31 | 1 | -27/+33 |
| | |||||
* | Using int() rather than long() | Sybren A. Stüvel | 2011-07-30 | 1 | -6/+6 |
| | |||||
* | Better type checking in core, casting ASN-ints to Python int | Sybren A. Stüvel | 2011-07-30 | 1 | -2/+4 |
| | |||||
* | Specify format (PEM/DER) in capitals | Sybren A. Stüvel | 2011-07-24 | 1 | -8/+8 |
| |