Skip to content

feat: add Python integrity verification with SHA-256#22

Open
sigelabriana-sketch wants to merge 1 commit into
javelin-anticheat:mainfrom
sigelabriana-sketch:main
Open

feat: add Python integrity verification with SHA-256#22
sigelabriana-sketch wants to merge 1 commit into
javelin-anticheat:mainfrom
sigelabriana-sketch:main

Conversation

@sigelabriana-sketch
Copy link
Copy Markdown

/claim #4

Summary

Implemented Python integrity verification for the Javelin Project.

What was added

Created anti_cheat.py with the following features:

  1. SHA-256 computation: Computes hash of the running script file using Python's built-in hashlib

  2. Environment variable check: Compares the computed hash against JAVELIN_EXPECTED_SHA256 env var

  3. Graceful handling:

    • If JAVELIN_EXPECTED_SHA256 is not set → skips check (like C++ with JAVELIN_EXPECTED_CRC32=0)
    • If hash matches → passes, exits with code 0
    • If hash mismatch → fails, exits with code 1

Usage

# Set expected hash
export JAVELIN_EXPECTED_SHA256="$(python3 anti_cheat.py --compute)"

# Run with integrity check
python3 anti_cheat.py

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.

1 participant