All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Path traversal fixed (
security.py,utils.py):InputValidator.validate_path()now rejects URI schemes (://,file:), UNC/network paths (\\\\,//), explicit..traversal sequences, and access to system directories (/etc/,C:\Windows\, etc.). An optionalallowed_baseparameter enforces directory confinement. - Scrypt KDF strengthened (
crypto.py): Scrypt fallback work factor raised fromn=2**15(32,768) ton=2**18(262,144) — 8x increase in GPU brute-force resistance. - Constant-time comparison (
security.py):TimingAttackMitigation.constant_time_compare()now delegates tohmac.compare_digest()(stdlib C implementation) eliminating thezip()-based early-termination risk present in the prior custom loop. - OverflowError in side-channel dummy ops fixed (
crypto.py): Added& ((1 << 256) - 1)bit-mask to the hash accumulator inSideChannelProtection.dummy_operations()to keep the integer within 256 bits and preventOverflowErrorduring extended operations. - Error message information disclosure fixed (
crypto.py): Decryption failure now raisesValueError("Authentication failed")instead of revealing whether the failure was due to a wrong key or data corruption.
- Audit HMAC key lazy-loaded (
audit.py):AUDIT_KEYis no longer a module-level global loaded at import time. A new_get_audit_key()function loads it on first use, reducing the window during which the key resides in memory. - Permission failures now logged (
audit.py,security.py):chmod()failures on the audit log and audit key files, andVirtualLock/mlockfailures on secure memory, are now logged as warnings instead of being silently swallowed. - Bare
exceptclauses removed (security.py): Replaced bareexcept:insecure_zero_memory()and memory-lock helpers withexcept (OSError, AttributeError, TypeError).
- Log sanitizer hardened (
crypto.py):_secure_log()now uses a compiled regex (re.sub) to redact all occurrences ofpassword=,key=,token=, etc. in a single pass, fixing the prior bug where only the first matching keyword was redacted. - Passphrase validation strengthened (
security.py,utils.py): Added maximum length cap (200 characters, DoS prevention) and repeated-character detection (>50% same char) toInputValidator.validate_passphrase()in both modules. - Backup restore schema validated (
backup.py):restore_from_backup()now calls_validate_backup_schema()before accessing nested keys, preventing unhandledKeyErroron malformed or malicious backup files.
cryptographyminimum version raised to>=38.0.0(aligns with current security support window).tqdmremoved from core dependencies (was unused at the library level).- Author email updated to
ajibijohnson@jtnetsolutions.com.
0.1.4 - 2025-10-18
- Removed all emojis from documentation for professional, enterprise-grade appearance.
- Replaced emoji-based section markers with clean, professional text formatting.
- Improved documentation accessibility and compatibility with all text processors.
- This change aligns the package with professional security library standards and improves documentation accessibility for screen readers and corporate environments.
0.1.3 - 2025-10-18
- Fixed PyPI README display by using
PYPI_README.mdinstead ofREADME.md(PyPI doesn't support Mermaid diagrams). - PyPI package page now shows properly formatted documentation without broken diagram syntax.
- The full documentation with interactive Mermaid diagrams is still available on GitHub.
0.1.2 - 2025-10-18
- Simplified
setup.pyto use all configuration frompyproject.toml(modern Python packaging best practice). - Updated package metadata: author email, GitHub URLs to correct repository.
- Updated license format in
pyproject.tomlto comply with modern packaging standards.
- Comprehensive architectural diagrams using Mermaid:
- High-level system architecture diagram
- Component architecture with module relationships
- Data flow sequence diagrams for all operations
- Cryptographic pipeline visualization
- File system layout diagram
- Security threat model diagram
- Detailed flowcharts for init, rotate, verify, restore, and PQC backend selection
- Enhanced documentation with visual guides in
README.mdandARCHITECTURE.md.
- Corrected Mermaid diagram syntax errors (simplified nested subgraphs, fixed direction declarations).
- Improved diagram readability with better color contrast (dark text on light backgrounds).
- Fixed PyPI build configuration to remove deprecated license classifier format.
- Updated all documentation to reflect the current modular architecture (removed references to old
BackupManagerclass).
0.1.1 - 2025-09-15
- BREAKING CHANGE: Refactored the entire project from a single script into a modular, installable Python package named
pqcdualusb. - Replaced the high-level
BackupManagerclass with a functional API (init_dual_usb,rotate_token, etc.) for more granular control. - Migrated all cryptographic logic, PQC operations, device handling, and auditing into separate modules (
crypto.py,pqc.py,device.py,audit.py). - Updated the PQC backend logic to prioritize a high-performance Rust implementation and fall back to
python-oqs. - Replaced manual file operations with a dedicated
storage.pymodule for managing state and orchestrating backups.
- Created a comprehensive test suite (
tests/test_all.py) usingunittestandunittest.mockto validate all core functionality. - Implemented a
pyproject.tomlfor modern, standardized package building and dependency management. - Added a
build_rust_pqc.pyscript to facilitate the compilation of the Rust backend. - Created a
cli.pyas a reference implementation for using the library's functions.
- Corrected numerous
ImportErrorandAttributeErrorissues that arose from the refactoring. - Resolved a
TypeErrorinstorage.pywhere aPathobject was incorrectly passed instead ofbytes. - Fixed a bug in
crypto.pywhereInvalidTagexceptions were not being correctly propagated on passphrase mismatch. - Patched tests to correctly mock file system interactions (
_is_removable_path), allowing the test suite to run in any environment.
- Removed the monolithic
dual_usb_backup.pyscript, with all its logic now residing in thepqcdualusbpackage.
0.1.0 - 2025-08-30
- Initial release of the monolithic script version.
- Post-quantum cryptography support with Dilithium digital signatures.
- Dual USB token architecture with split secret design.
- Memory protection with secure allocation and automatic cleanup.
- Timing attack resistance with constant-time operations.
- Cross-platform USB detection for Windows, Linux, and macOS.
- Atomic write operations to prevent data corruption.
- Comprehensive audit logging with tamper-evident chains.
- Interactive CLI with smart drive selection.