Post
Topic
Board Games and rounds
Re: [FREE PRIVATE GIVEAWAY] Bitcoin keychain
by
GazetaBitcoin
on 18/02/2020, 17:20:37 UTC

How do they know who are the winner if they don't know what their sha256 hash is  Huh  
They have the giveaway code, if they create a sha256 hash of the code they have at hand, they know their slot number, so they'll know if they won.

On linux, it's basically:
Code:
echo -n giveawaycode | sha256sum

On windows i have no idear, but you can use one of the many online tools to calculate a sha256 hash, like https://emn178.github.io/online-tools/sha256.html

Here is a small tutorial posted by nullius a while ago. I hope it helps everybody.
The SHA-256 hash (same as used in Bitcoin) will positively identify the file, without revealing its contents.  If the script then were to be later revealed by any means, either publicly or to a private auditor, it could be affirmatively verified whether or not it is the same script as you now have in your possession.  Changing even one byte—even one bit of the file would change the hash value.

An example of what a SHA-256 hash may look like (here represented in hex):

Code:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

By posting a hash, you would be making a cryptographic commitment.  As long as you can produce a file exactly matching whatever hash you post, nobody could later accuse you of changing the script, or substituting a different script.  —  And yet, you would not be revealing the script.

Thus, my suggestion that you post a hash.  scam_detector has called on you to reveal the script itself.  I have suggested that it would be wiser to have your commitment to the identity of the script, and then discuss what should be done about the actual script.

Assuming that the file is named “alia_script” (substitute the appropriate name), on Linux:

Code:
sha256sum alia_script

On Windows (not sure which versions):

Code:
certUtil -hashfile alia_script SHA256

On Mac:  Don’t know.  On FreeBSD, it would be “sha256 alia_script”; but I seriously doubt you be on FreeBSD.