# Changelog All notable changes to this project are documented in this file. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/). --- ## [2.1.6] — 2026-09-27 Packaging and documentation release. The algorithm is unchanged; this version restructures the project as a distributable library and brings the documentation in line with it. ### Added - **Bilingual interactive TUI.** A menu-driven interface with English and Chinese, switchable at runtime. Uses `getpass` for password entry on a terminal and degrades to plain input when piped, so it remains scriptable. - **Full command line interface.** Subcommands `keygen`, `encrypt`, `decrypt`, `file`, `info`, `chpwd` and `tui`, with `--json` output, stdin/stdout piping, and three ways to supply each password (inline, environment variable, password file). - **Unified error hierarchy.** Sixteen named error types, all subclasses of `ChaosCryptError`, each rendering as `ChaosCrypt_ERR__`. Every failure path in the library now raises rather than returning a sentinel. - **Binary and file support.** `encrypt_bytes` / `decrypt_bytes` for arbitrary binary data, and `encrypt_file` / `decrypt_file` for whole files. - **Key management helpers.** `change_key_password` re-wraps a key file under a new password without altering the key material. `export_key_text` and `load_from_text` move a key without touching disk. - **Comprehensive documentation.** `SECURITY.md` presents the design, key space derivation, threat model and attack analysis in full. `docs/` contains API, CLI and architecture references. - **Test suite.** Round-trip integrity, binary safety, key management, error types, CLI behaviour, TUI interaction, internationalisation, and bidirectional interoperability with the original implementation. - **Packaging.** `pyproject.toml`, `MANIFEST.in`, `.gitignore`, `py.typed`, runnable examples, and MIT licensing. ### Changed - **Project restructured** into a standard library layout. The importable package now lives at `chaoscrypt/`, with tests, examples and the legacy implementation alongside it, and documentation and build artefacts at the repository root. - **Code comments unified in English**, and public docstrings expanded to document parameters, return values and raised errors. - **English is now the default UI language**, with Chinese available as an alternative. - **Packaging metadata** updated for the new layout and SPDX licence expression. ### Fixed Six defects found and corrected during the restructure: 1. The `-p` and `-P` option groups both registered `--pwd`, causing an `argparse` conflict that prevented the CLI from starting at all. 2. An incorrect key file password was reported as a corrupted file (`E002`) rather than a credential error (`E003`). A structural validation step now distinguishes the two cases. 3. `export_key_text` produced key material without loading it into the instance, so the returned key could not be used directly. 4. **Non-hexadecimal input was accepted as ciphertext and silently decrypted into garbage.** This was the most serious defect: a corrupt or truncated ciphertext was indistinguishable from a successful decryption. Malformed input now raises `E010` before any processing occurs. 5. The TUI failed outright under piped input, because `getpass` requires a TTY. It now detects this and falls back to plain input. 6. After generating a key file, the TUI continued to look at the default file name rather than the one just created. The key file is now remembered for the rest of the session. ### Security - Clearly documented that ChaosCrypt is unaudited and non-standardised, and that it is intended for obfuscation, personal use, and research or teaching rather than production deployment. - Documented the deterministic-output property and its consequences, and the information disclosed by ciphertext length and Base64 padding class. - Documented the strength of the construction in full, including the approximately 10^5621 key space, the absence of algebraic and number-theoretic structure, and the effect of Shor's and Grover's algorithms. ### Compatibility Fully backward compatible with the original single-file implementation, in both directions: - key files produced by either implementation load in the other; - ciphertext produced by either implementation decrypts in the other; - the default key file name remains `encryption.key`, and the on-disk key file format is unchanged. --- ## [2.0.0] — Original release The original single-file implementation of the ChaosCrypt cipher. ### Added - Random system key generation: independent uppercase and lowercase bijections, digit and padding substitutions, a 10-bit case-flip pattern, a 4096-nibble long key and a 512-nibble short key. - Password-protected key file wrapping. - Layered encryption: Base64 encoding, substitution, conditional case flipping, whole-message reversal, and two XOR stages. - Interactive menu for encryption, decryption and key management. [2.1.6]: https://git.dvscloud.net/dvs/ChaosCrypt/releases/tag/v2.1.6 [2.0.0]: https://git.dvscloud.net/dvs/ChaosCrypt/releases/tag/v2.0.0