--------------------------
Major Changes
^^^^^^^^^^^^^
- Security Patch: ``xor`` & ``axor`` functions that define the
one-time-pad cipher had a vulnerability fixed that can leak <1-bit of
plaintext. The issue was in the way keys were built, where the
multiplicative products of two key segments were xor'd together. This
lead to keys being slightly more likely to be positive integers,
meaning the final bit had a greater than 1/2 probability of being a
``0``. The fix is accompanied with an overhaul of the one-time-pad
cipher which is more efficient, faster, & designed with a better
understanding of the way bytes are processed & represented. The key
chunks now do not, & must not, surpass 256 bytes & neither should
any chunk of plaintext output. Making each chunk deterministically
256 bytes allows for reversibly formatting ciphertext to & from
bytes-like strings. These changes are backwards incompatible with
prior versions of this package & are strongly recommended.
- Added ``bytes_xor`` & ``abytes_xor`` functions which take in key
generators which produce key segments of type bytes instead of hex
strings.
- ``AsyncDatabase`` & ``Database`` now save files in bytes format,
making them much more efficient on disk space. They use the new
``BytesIO`` class in the ``generics`` module to transparently convert
to & from json & bytes. This change is also not backwards compatible.
- Removed ``acipher``, ``cipher``, ``adecipher``, ``decipher``,
``aorganize_encryption_streams``, ``organize_encryption_streams``,
``aorganize_decryption_streams``, ``organize_decryption_streams``,
``aencrypt``, ``encrypt``, ``adecrypt``, ``decrypt``, ``asubkeys`` &
``subkeys`` generators from the ``ciphers`` module & package to slim
down the code, remove repetition & focus on the cipher tools that
include hmac authentication.
- Removed deprecated diffie-hellman methods in ``Ropake`` class.
- Removed the static ``power10`` dictionary from the package.
- The default secret salt for the ``Ropake`` class is now derived from the
contents of a file that's in the databases directory which is chmod'd to
0o000 unless needed.
- Made ``aclient_message_key``, ``client_message_key``, ``aserver_message_key``,
& ``server_message_key`` ``Ropake`` class methods to help distinguish
client-to-server & server-to-client message keys which prevents replay
attacks on the one-message ROPAKE protocol.
- Added protocol coroutines to the ``Ropake`` class which allow for easily
engaging in 2DH & 3DH elliptic curve exchanges for servers & clients.
- Efficiency improvements to the ``aseeder`` & ``seeder`` generator functions
in the ``randoms`` module. This affects the ``acsprng`` & ``csprng`` objects
& all the areas in the library that utilize those objects.
- Changed the repr behavior of ``Comprende`` instances to redact all args &
kwargs by default to protect cryptographic material from unintentionally
being displayed on user systems. The repr can display full contents by
calling the ``enable_debugging`` method of the ``DebugControl`` class.
- All generator functions decorated with ``comprehension`` are now given
a ``root`` attribute. This allows direct access to the function without
needing to instantiate or run it as a ``Comprende`` object. This saves
a good deal of cpu & time in the overhead that would otherwise be
incurred by the class. This is specifically more helpful in tight &/or
lower-level looping.
Minor Changes
^^^^^^^^^^^^^
- Various refactorings across the library.
- Fixed various typos, bugs & inaccurate docstrings throughout the library.
- Add ``chown`` & ``chmod`` functions to the ``asynchs.aos`` module.
- Now makes new ``multiprocessing.Manager`` objects in the ``asynchs.Processes``
& ``asynchs.Threads`` classes to avoid errors that occur when using a stale
object whose socket connections are closed.
- Changed ``Ropake`` class' ``adb_login`` & ``db_login`` methods to
``adatabase_login_key`` & ``database_login_key``. Also, fix a crash bug in
those methods.
- Changed ``Ropake`` class' ``aec25519_pub``, ``ec25519_pub``, ``aec25519_priv``
& ``ec25519_priv`` methods to ``aec25519_public_bytes``, ``ec25519_public_bytes``,
``aec25519_private_bytes`` & ``ec25519_private_bytes``.
- Added low-level private methods to ``Ropake`` class which do derivation
& querying of the default class key & salt.
- Behavior changes to the ``ainverse_int`` & ``inverse_int`` functions in the
``generics`` module to allow handling bases represented in ``str`` or ``bytes``
type strings.
- Behavior & name changes to the ``abinary_tree`` & ``binary_tree`` functions in the
``generics`` module to ``abuild_tree`` & ``build_tree``. They now allow making
uniform trees of any width & depth, limited only by the memory in a
user's machine.
- Provided new ``acsprbg`` & ``csprbg`` objects to the library that return 512-bits
of cryptographically secure pseudo-random ``bytes`` type strings. They are
made by the new ``abytes_seeder`` & ``bytes_seeder`` generators.
- The ``csprng``, ``acsprng``, ``csprbg`` & ``acsprbg`` objects were
wrapped in functions that automatically restart the generators if they're
stalled / interrupted during a call. This keeps the package from melting
down if it can no longer call the CSPRNGs for new entropy.
- Cleaned up & simplified ``table_key`` functions in the ``keygens`` module.
- Changed the output of ``asafe_symm_keypair`` & ``safe_symm_keypair`` functions
to contain bytes values not their hex-only representation. Also removed
these functions from the main imports of the package since they are slow
& their main contribution is calling ``arandom_number_generator`` &
``random_number_generator`` to utilize a large entropy pool when starting
CSPRNGs.
- Added new values to the ``bits`` dictionary.
- Added ``apad_bytes``, ``pad_bytes``, ``adepad_bytes`` & ``depad_bytes``
functions which use ``shake_256`` to pad/depad plaintext bytes to & from
multiples of 256 bytes. They take in a key to create the padding.
This method is intended to also aid in protecting against padding
oracle attacks.