Name Description Size
__init__.py RSA module Module for calculating large primes, and RSA encryption, decryption, signing and verification. Includes generating public and private keys. WARNING: this implementation does not use compression of the cleartext input to prevent repetitions, or other common security improvements. Use with care. 1607
asn1.py ASN.1 definitions. Not all ASN.1-handling code use these definitions, but when it does, they should be here. 1740
cli.py Commandline scripts. These scripts are called by the executables defined in setup.py. 9862
common.py Common functionality shared by several modules. 4679
core.py Core mathematical operations. This is the actual core RSA implementation, which is only defined mathematically on integers. 1661
key.py RSA key generation code. Create new keys with the newkeys() function. It will give you a PublicKey and a PrivateKey object. Loading and saving keys requires the pyasn1 module. This module is imported as late as possible, such that other functionality will remain working in absence of pyasn1. .. note:: Storing public and private keys via the `pickle` module is possible. However, it is insecure to load a key from an untrusted source. The pickle module is not secure against erroneous or maliciously constructed data. Never unpickle data received from an untrusted or unauthenticated source. 27427
parallel.py Functions for parallel computation on multiple cores. Introduced in Python-RSA 3.1. .. note:: Requires Python 2.6 or newer. 2309
pem.py Functions that load and write PEM-encoded files. 3989
pkcs1.py Functions for PKCS#1 version 1.5 encryption and signing This module implements certain functionality from PKCS#1 version 1.5. For a very clear example, read http://www.di-mgt.com.au/rsa_alg.html#pkcs1schemes At least 8 bytes of random padding is used when encrypting a message. This makes these methods much more secure than the ones in the ``rsa`` module. WARNING: this module leaks information when decryption fails. The exceptions that are raised contain the Python traceback information, which can be used to deduce where in the process the failure occurred. DO NOT PASS SUCH INFORMATION to your users. 16205
pkcs1_v2.py Functions for PKCS#1 version 2 encryption and signing This module implements certain functionality from PKCS#1 version 2. Main documentation is RFC 2437: https://tools.ietf.org/html/rfc2437 3449
prime.py Numerical functions related to primes. Implementation based on the book Algorithm Design by Michael T. Goodrich and Roberto Tamassia, 2002. 5106
py.typed 63
randnum.py Functions for generating random numbers. 2657
transform.py Data transformation functions. From bytes to a number, number to bytes, etc. 2200
util.py Utility functions. 2993