Skip to content

feat: add SHA-256 self-integrity verification for Python (#4) - #45

Open
pvbang wants to merge 1 commit into
javelin-anticheat:mainfrom
pvbang:feat/4-python-sha256-integrity
Open

feat: add SHA-256 self-integrity verification for Python (#4)#45
pvbang wants to merge 1 commit into
javelin-anticheat:mainfrom
pvbang:feat/4-python-sha256-integrity

Conversation

@pvbang

@pvbang pvbang commented Jun 16, 2026

Copy link
Copy Markdown

/claim #4

Summary

Implements the integrity verification requested in #4 for the Python implementation.

anti_cheat.py computes the SHA-256 of its own running script file and compares it against the JAVELIN_EXPECTED_SHA256 environment variable. On mismatch it performs a guarded exit (code 0x0C8C) instead of running tampered code. When the variable is unset, the check is a safe no-op (optional, mirroring the C++ build-time constant).

Acceptance criteria

  • AC1 - Tampered script (hash mismatch) triggers guarded exit with a clear stderr message; correct hash continues cleanly. Verified by end-to-end subprocess tests.
  • AC2 - README documents how to compute (sha256sum / Get-FileHash / portable Python one-liner) and set JAVELIN_EXPECTED_SHA256.
  • Mirrors existing C++ guards, stdlib-only, cross-platform.

Tests

9 tests passing under both pytest and the stdlib fallback runner.

Files

  • anti_cheat.py (new)
  • test_anti_cheat.py (new)
  • README.md (updated)
  • .gitignore (new)

Closes #4


Bounty payout wallet (ETH): 0x911d202f713Ee2ad139E8b8b8a0A712347eFE31f

…icheat#4)

Implements integrity verification requested in issue javelin-anticheat#4:
- anti_cheat.py computes SHA-256 of the running script file and compares
  it against the JAVELIN_EXPECTED_SHA256 environment variable.
- Non-matching hash -> guarded exit (code 0x0C8C). (AC1)
- README documents how to compute and set the expected value. (AC2)
- Also mirrors C++ guards: debugger detection + suspicious-process scan.
- Full test suite (9 tests, pytest + stdlib fallback), all passing.

Fixes javelin-anticheat#4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add Integrity Verification (Hash of Executable/Script)

1 participant