Implement KeyGuard 4.0: complete rewrite with v3→v4 migration#2
Merged
Crypt-Guard merged 1 commit intomainfrom Feb 15, 2026
Merged
Implement KeyGuard 4.0: complete rewrite with v3→v4 migration#2Crypt-Guard merged 1 commit intomainfrom
Crypt-Guard merged 1 commit intomainfrom
Conversation
Major refactoring of KeyGuard.py (2,588 lines) into a well-structured Python package with 18 modules across 7 sub-packages. Key changes: - Remove ALL debugger detection code (ProcessProtection, ptrace, IsDebuggerPresent, ALLOW_DEBUGGING, os._exit, continuous_check) - New v4 vault format with self-descriptive KDF params in header - v3→v4 automatic migration with backup - KDF profiles: compat (64 MiB), balanced (256 MiB), high (512 MiB) - Cross-platform dirs via platformdirs (XDG on Linux) - Auto-migrate from legacy ~/.keyguard3 - Clipboard auto-clear after 15 seconds - Thread-safety fixes: locks on PasswordTimeout, KeyObfuscator, TimedExposure - Bug fixes: FD leak in lock, backup path parsing, temp file permissions, atomic config write, entry order mutation in list_entries - 63 pytest tests: crypto roundtrip, tamper detection, vault CRUD, v3→v4 migration, backup restore, memory management - GitHub Actions CI for ubuntu-latest + windows-latest - pyproject.toml with ruff + black configuration https://claude.ai/code/session_01QFXUR2eEwC6mUgrQjMEQ6S
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a complete rewrite of KeyGuard, introducing version 4.0 with a modern architecture, improved security practices, and seamless migration from legacy v3 vaults. The codebase has been restructured into modular components with clear separation of concerns: cryptography, storage, vault management, UI, and utilities.
Key Changes
Core Architecture
crypto/,storage/,vault/,ui/, andutil/packagesSecurity Enhancements
SecureMemory): Multi-pass wipe, platform-specific memory locking (mlock/VirtualLock), and obfuscationVault Format Evolution
compat(64 MiB),balanced(256 MiB),high(512 MiB) with security floor enforcementUI & UX
SecureMemoryobjects, never plain stringsConfiguration & Paths
Testing
Notable Implementation Details
SecureMemorywith guaranteed cleanupMigration Path
Users with existing v3 vaults can seamlessly upgrade: opening a v3 vault automatically migrates it to v4 format with
https://claude.ai/code/session_01QFXUR2eEwC6mUgrQjMEQ6S