I'm trying to find an algorithm to prove that someone knows some short secret message (for example some prediction of the future) before finally revealing it.
For example:
Alice knows what temperature will be outside tomorrow, she wants to prove to Bob that she had it without revealing the number until tomorrow. Bob on the other hand needs Alice to not be able to fake her prediction after the fact.
I have come up with a draft scheme that goes like this:
Alice generates long random strings $r_s, r_p$.
Alice sends $hash(r_s . r_p . T)$, and the $r_p$ to Bob.
Here $T$ is the predicted temperature (a two-digit number).
The next day Alice sends the $r_s$, and $T$ to Bob, so he can now verify, that Alice knew the $T$ at step 2, proving Alice had predicted the future.
Is it ok?, or could you point me to a better solution? If it is ok, what special properties should the $hash$ function has if any, except being cryptographically secure?