SHA-256 file integrity hash

Started by MrBcx, February 28, 2025, 01:03:06 PM

Previous topic - Next topic

MrBcx

In the future when I upload new versions of BCX, I will be including a SHA-256 file integrity hash.

I have retroactively added the hash to Bcx825.zip:

https://bcxbasiccoders.com/smf/index.php?topic=1309.0



How do you use the SHA-256 value?

I've prepared a batch file below.  simply drag and drop a file onto it and that file's SHA-256 will be displayed.

If that value matches the value on the the download page then that indicates the file has not been altered.



certutil -hashfile "%1" SHA256

pause



dragon57

Just in case someone would like a GUI for this type of operation, the free 7-Zip GUI provides a rather comprehensive set of hashes.

Quin

-Quin.
GitHub

MrBcx

I'll be posting a cool little related desktop tool tomorrow.  Watch for the announcement.

airr

Hi, MrB.

Quick request:  Could you also place a text file containing the sha256 checksum in the Bcx_Files_New area?

Formatted like:


439e0d570720fb1d59ac9133d2839fc30eb2292c233fb2657369095cd10cbd64 Bcx825.zip


The reason for my request is because I have a little utility that checks for the latest version of BCX and downloads it.  I'd like to incorporate something like this into that:



Dim sha256$, chksumfile$, expectedSha256$[2],certCmd$

chksumfile$ = trim$(LoadFile$("Bcx825.sha256"))
split(expectedSha256$,chksumfile$," ")

sprint certCmd$, "certutil -hashfile ", expectedSha256$[1], " SHA256 | findstr /R [0-9][a-z] > tmp.txt"

shell certCmd$

sha256$ = trim$(LoadFile$("tmp.txt"))

if sha256$ = expectedSha256[0] then
    print expectedSha256$[1], ": Ok."
else
    print "Checksums don't match!"
    print "Expected Checksum: ", expectedSha256$[0]
    print "Actual Checksum:   ", sha256$
endif

kill "tmp.txt"



AIR.

MrBcx

#5
Hi Armando,

No ... but I am willing to give you this format:

Bcx825.zip 439e0d570720fb1d59ac9133d2839fc30eb2292c233fb2657369095cd10cbd64


That keeps the associated zip and sha-256 files adjacent to each other when I'm in my FTP client.

825 is in place, so you can test your process whenever you're ready.


airr

See attached zip file and screenshot.

Compiles with Pelles and MSVC.

AIR.

MrBcx

Fantastic as usual Armando - it borders on magic it's so good!   

For BED users, AIR's Download & Verifier would be one really useful addition to BED's Tool Menu.

The irony is that I'll never need to use it because I'm the guy supplying the BCX updates.  :D








Robert

Quote from: airr on March 01, 2025, 09:02:23 PM
See attached zip file and screenshot.

Compiles with Pelles and MSVC.

AIR.

Yes, absolutely useful. Thank you.

jbk


Quin

Quote from: airr on March 01, 2025, 09:02:23 PM
See attached zip file and screenshot.

Compiles with Pelles and MSVC.

AIR.
This is super handy, thanks Airr!
-Quin.
GitHub