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 random padding, compression of the cleartext input to prevent repetitions, or other common security improvements. Use with care. If you want to have a more secure implementation, use the functions from the ``rsa.pkcs1`` module. 1568
_compat.py Python compatibility wrappers. 4059
_version133.py RSA module pri = k[1] //Private part of keys d,p,q Module for calculating large primes, and RSA encryption, decryption, signing and verification. Includes generating public and private keys. WARNING: this code implements the mathematics of RSA. It is not suitable for real-world secure cryptography purposes. It has not been reviewed by a security expert. It does not include padding of data. There are many ways in which the output of this module, when used without any modification, can be sucessfully attacked. 11274
_version200.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 random padding, compression of the cleartext input to prevent repetitions, or other common security improvements. Use with care. 15007
asn1.py ASN.1 definitions. Not all ASN.1-handling code use these definitions, but when it does, they should be here. 1147
bigfile.py Large file support - break a file into smaller blocks, and encrypt them, and store the encrypted blocks in another file. - take such an encrypted files, decrypt its blocks, and reconstruct the original file. The encrypted file format is as follows, where || denotes byte concatenation: FILE := VERSION || BLOCK || BLOCK ... BLOCK := LENGTH || DATA LENGTH := varint-encoded length of the subsequent data. Varint comes from Google Protobuf, and encodes an integer into a variable number of bytes. Each byte uses the 7 lowest bits to encode the value. The highest bit set to 1 indicates the next byte is also part of the varint. The last byte will have this bit set to 0. This file format is called the VARBLOCK format, in line with the varint format used to denote the block sizes. 3101
cli.py Commandline scripts. These scripts are called by the executables defined in setup.py. 12016
common.py Common functionality shared by several modules. 4716
core.py Core mathematical operations. This is the actual core RSA implementation, which is only defined mathematically on integers. 1668
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. 18177
parallel.py Functions for parallel computation on multiple cores. Introduced in Python-RSA 3.1. .. note:: Requires Python 2.6 or newer. 2212
pem.py Functions that load and write PEM-encoded files. 3372
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 or verification 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. 13170
prime.py Numerical functions related to primes. Implementation based on the book Algorithm Design by Michael T. Goodrich and Roberto Tamassia, 2002. 3905
randnum.py Functions for generating random numbers. 2414
transform.py Data transformation functions. From bytes to a number, number to bytes, etc. 6848
util.py Utility functions. 2938
varblock.py VARBLOCK file support The VARBLOCK file format is as follows, where || denotes byte concatenation: FILE := VERSION || BLOCK || BLOCK ... BLOCK := LENGTH || DATA LENGTH := varint-encoded length of the subsequent data. Varint comes from Google Protobuf, and encodes an integer into a variable number of bytes. Each byte uses the 7 lowest bits to encode the value. The highest bit set to 1 indicates the next byte is also part of the varint. The last byte will have this bit set to 0. This file format is called the VARBLOCK format, in line with the varint format used to denote the block sizes. 4360