Toycrypto

Latest version: v0.2.2

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.2.2

Fixed

- CCA2 game no longer rejects decryption of ctexts that were created in previous rounds

Changed

- `sec_games.<game>.T_TABLE` has had a type change, with use of enumerations.

Added

- State diagrams for sec_games documentation.

- Enums for states and transitions for `sec_games`.

Yes, they are ugly, and Graphviz makes it hard to place edge labels well,
but I worked on this, so you have to see them.

- Expanded (perhaps excessively) sec_games documentation.

0.2.1

Fixed

- PyPi package metadata should now be correct.

Added

- IND-CCA games are now available.

- Exposed challenger state transition tables for IND-{EAV,CPA} games in `T_TABLE` for each class.

0.2.0

Changed

- Minimum Python version is now 3.12

This was needed for type aliases with type parameters.

Added

- `IndCpa` is back (and distinct from `IndEav`)

0.1.7

Changed

- `IndCpa` is now correctly called `IndEav`

0.1.6

Added

- `sec_games` module with symmetric IND-CPA game

Changed

- birthday.Q uses simple approximation when p > MAX_BIRTHDAY_Q instead of raising exception

Improved

- Improved test coverage for birthday module
- Documentation improvements

0.1.5

Changed

- `vigenere` now only works with `str`. If you want to do things with `bytes`, use `utils.xor`.

- Vigenère encryption and decryption no longer advance the key when passing through input that is not in the alphabet.

Fixed

- Vigenère behavior on input not in alphabet is less incoherent than before, though perhaps it should be considered undefined.

- Sprinkled more `py.typed` files around so this really should get marked at typed now.

Added

- `utils.hamming_distance()` is now a thing.
- `vigenere.probable_keysize()` is also now a thing.
- `utils.xor()` can take an Iterator[int] has a message, so the entire message does not need to be stored
- The `utils.Xor` class creates an Iterator of xoring a message and a pad.

Improved

- `birthday` module now has a [documentation page](https://jpgoldberg.github.io/toy-crypto-math/birthday.html).
- `types` module now has a [documentation page](https://jpgoldberg.github.io/toy-crypto-math/types.html).

Page 1 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.