HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/current/platform/gsutil/third_party/rsa/doc/reference.rst
Reference
=========

This is the class and function reference. For more usage information
see the :ref:`usage` page.

Functions
---------

.. autofunction:: rsa.encrypt

.. autofunction:: rsa.decrypt

.. autofunction:: rsa.sign

.. autofunction:: rsa.verify

.. autofunction:: rsa.find_signature_hash

.. autofunction:: rsa.newkeys(keysize)


Classes
-------

.. 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.

.. autoclass:: rsa.PublicKey
    :members:
    :inherited-members:

.. autoclass:: rsa.PrivateKey
    :members:
    :inherited-members:

Exceptions
----------

.. autoclass:: rsa.pkcs1.CryptoError(Exception)

.. autoclass:: rsa.pkcs1.DecryptionError(CryptoError)

.. autoclass:: rsa.pkcs1.VerificationError(CryptoError)


.. index:: VARBLOCK (file format)

The VARBLOCK file format
++++++++++++++++++++++++

.. warning::

    The VARBLOCK format is NOT recommended for general use, has been deprecated since
    Python-RSA 3.4, and was removed in version 4.0. It's vulnerable to a
    number of attacks. See :ref:`bigfiles` for more information.

The VARBLOCK file format allows us to encrypt files that are larger
than the RSA key. The format is as follows; || denotes byte string
concatenation::

 VARBLOCK := VERSION || BLOCK || BLOCK || ...

 VERSION := 1

 BLOCK := LENGTH || DATA

 LENGTH := varint-encoded length of the following data, in bytes

 DATA := the data to store in the block

The varint-format was taken from Google's Protobuf_, and allows us to
efficiently encode an arbitrarily long integer.

.. _Protobuf:
    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
of much use to you, but I wanted to document them anyway as they are
the core of the entire library.

.. autofunction:: rsa.core.encrypt_int

.. autofunction:: rsa.core.decrypt_int