Hacker News new | ask | show | jobs
by pvg 390 days ago
If you write something super short someone could guess the hash for it.

You can skip the pdf and unless the thing is so short/predictable you can guess it outright, nobody is going to 'guess' the hash. E.g. 'I made up a random 64 byte sequence, here's its cryptographic hash, guess the sequence' - that doesn't happen.

1 comments

If the sentence is too short it might be possible to guess.

It’s not going to consist of random bytes.

Imagine for example that a high profile celebrity accused of murder has successfully defended himself in court and on that day he tweets:

I have something to reveal, but I won’t be telling you until the year 2135. Sha256 73fa194342af6b6e355e129fafd9b19d2a63589b1e3c6e2b5d94a7ca1b3e25f6

If this happens to be a short sentence related to recent events, don’t you think someone will figure out what he wrote pretty soon?

You can just pad or HMAC the short sentence.
Absolutely. Padding it falls under making sure the text is not too short.