Using Hash Functions To Make Predictions And Publish Safely1
TL;DR
I'm going to use Hashes to create and publish placeholders for posts. They'll stand in for writing I'm afriad to publish right now.
Assuming things get better, I'll publish the original texts. The hashes can be used to confirm it's what I wrote on the original date.
Not As Random As It Looks
This chain of numbers and letters proves I wrote a specific sentence:
d462149cf49bee1d43c3818e509e4402616dd3b7a75bbe2db65a1769efcd3afe
It's called a Hash. The result of passing my sentence through a Hashing Function2. They can be used for the computer equivalent of sticking a prediction in an envelope to be revealed later.
Hash Mechanics
The details of hash functions get pretty math heavy3. I don't worry about that stuff. I care about two things:
- Feeding the same input into a hash function always produces the same output
- You can't use the output to reproduce the input
That means there's no way to use the hash to pull out the original sentence I wrote4. No getting an early peak at my prediction.
It also means when I give you the sentence you can run it through the hash function to see the same set of letters and numbers. The match proves I wrote the sentence sometime before I published the hash5.
The (Digital) Envelope, Please
I use hash functions all the time. They're great for making sure data you're working with didn't get changed without you knowing6.
I never thought about using them for Envelope Predictions7 until I saw this thread from mcc on Mastodon.
They posted a few hashes on new year's eve. Kinda like a resolution. But, without promoting what they planning to do. When they knock one off, they post the original text of the resolution. Running it through the hashing function shows the same mix of random looking characters. You know it's what they typed to create the original post.
Check Back Later
I realized there's a similar way to use hashes. Not to make predictions. But, to write something and use the hash as a placeholder until you're ready to publish it for real.
For example, I'm increasingly wary of posting anything even remotely political. The possibility of the government slurping up content, using it to identify dissenters, and shipping them off to camps is entirely too real.
I want to write. Both because the act of writing helps me process things and because it would add to the collection of things historians will be able to use to look back on this time8.
But, I don't want to make myself more of a target9. Using hashes gives me a way to put down my thoughts while providing having some cover10.
-a
Endnotes
I'm not completely averse to making political statements online. The words of First They Came ring loud.
To wit: systemic racism/sexism/pick-your-ism exists. We should work to remove and correct it. Removing books by Maya Angelou while leaving Mein Kampf in a military library is about as fucked-up as you can get. Trying to remove trans folks from existence is orders of magnitude more fucked than that.
Any questions?
If you're on a computer that can run sha256 from a terminal command line, give this a shot:
echo -n "Be mighty, create the thing... make the world better." | sha256
You'll see the hash from the start of the post:
d462149cf49bee1d43c3818e509e4402616dd3b7a75bbe2db65a1769efcd3afe
The text is a quote from The Gibson from Hackers.town on Mastodon
Footnotes
Well, at least publish "safer". There's no way I know of for publishing to be completely safe.
"A hash function is any function that can be used to map data of arbitrary size to fixed-size values, though there are some hash functions that support variable-length output."
They could pull these formulas to make one of those thinking hard memes with all the math symbols floating around.
There's an important caveat here.
There's no way to pass the output of a hash function into another function to produce the input. However, it's entirely possible to make a list of a bunch of inputs and run them through the hash function to pre-calculate their outputs.
You end up with what's called a Rainbow Table . A map that lets you search for an output and see the corresponding input (assuming it was one that you have in your table).
The larger the input, the less likely it is to be in a Rainbow Table. For example, Rainbow Tables that are used to crack passwords almost certainly contain entries for "password", "password1", "password2", etc... But, they're way less likely to contain entires for collections of random words because there are so many possible combinations.
Imagine how many you can make by combining four random words you pick from the dictionary. Just don't use "correct horse battery staple". It's already spoken for.
Skip it and you'll be fine until they bring in the wrench.
The other caveat to mention is Hash Collisions. The hash function I'm using here is called SHA-256 (which is part of the SHA-2 family). It always outputs hashes of the same length (64 characters) regardless of how long the input is.
Use an "a" as input, you get 64 characters. Send in the combined text of every book Stephen King has ever written, you still get 64 characters.
Because those 64 characters have to represent inputs bigger than the amount of data they can store directly, multiple inputs can produce the same output. These are the collisions.
Because of the way the math works, it's most likely that a collision for any given input you care about will be nothing band random gibberish. Check out the Hash Collisions page for more info if you're interested.
Anything that can be stored on a computer can be sent into a hash function. For example, I'll send files into one to get a hash value for it and store the hash in a database. I can go back and rehash the file later to see if it changed. I can use that indicator to determine if I need to do something with it.
It's great for Caching.
I wouldn't be surprised if there's a specific term for sticking a prediction in an envelope to reveal it later. The closest I could find is Billet reading. That's a mentalist trick though. I'm talking about doing it legit.
Not that there's anything particularly special about my writing. I mean, I like what I write and hope it's useful, but it's more about contributing to the tonnage.
I've got bipolar disorder. I've posted a lot about it on here and other places around the web. Plus, there are the medical records of my trips to the psych ward. With the speeches from the administration about putting folks with mental health issues in camps, it already feels like they'll be coming for me at some point.
And, yes. I could totally just drop the posts in later without all the fuss. But, I like the idea that someone can use something like the Internet Archive's Wayback Machine to verify the timing.
It's also acts as a signal about how afraid I am of things over time.