r/Python • • Oct 21 '26

Resource Python Hash Verification

My boss is thinking about using python in a secure VPN environment. Because of this, we have to validate the hash of the python download and any libraries used.

I looked on the site but didn't see anything. Is there somewhere we can find the hash value so we can validate the download vs the hash code?

11 Upvotes

8 comments sorted by

3

u/BeasleyMusic Oct 22 '26

There’s a million better ways, why not use FOSSA to validate vulnerabilities in dependencies?

2

u/GrumpyHubby Oct 23 '26

All of this is the first time I heard of doing this. I had seen the hashes in the past but never paid them any attention. So this is all new to me in how it works.

1

u/matthewthompson1 28d ago

python.org has sha256 checksums for every release, and gpg signatures too up through 3.13. 3.14 and later ditched gpg for sigstore instead, so just check which one applies to whatever version youre actually pulling

1

u/deadeye_82_1 28d ago

Python uses now sigstore instead of GPG.

Install sigstore: py -m pip install sigstore

Command to check:

python -m sigstore verify identity python-3.15.2-amd64.exe --certificate python-3.15.2-amd64.exe.crt --signature python-3.15.2-amd64.exe.sig --cert-identity hugo@python.org --cert-oidc-issuer https://github.com/login/oauth

And yes, 3.15.2 is out.
To upgrade with Python install manager: py install --upgrade

1

u/Early-Sir-932 27d ago

each version's release page on python.org has an md5 column next to every file, and a sigstore column too if you need something stronger than md5

33

u/[deleted] Oct 21 '26

[removed] — view removed comment

3

u/GrumpyHubby Oct 21 '26

Thank you. I didnt realize I was calling it the wrong thing until I saw your reply.

I'll check that out. Thanks.

6

u/tsetem Oct 21 '26

This 100%.

And same thing with your wheels for packages your download. When specifying your packages and what was downloaded, doing like a ‘uv lock’ will write out the checksums for all of the libraries so you have proof of the libraries that should be installed and should match the origin

Look into SBOM if you want to get more details about the concept