imriss
imriss

Reputation: 1981

Is it possible to infer on the complexity of the input text of a sha256 hash?

Consider the following example:

require(digest)

text_short <- "The short text."
text_long <- "The long text. This is a longer text for the purpose of testing."

text_short_hashed <- digest(text_short, algo="sha256")
[1] "6e504cb5660d8614be9465a3a9c0e0db9889d897cfd9e7432f98e5df566e9e95"
text_long_hashed <- digest(text_long, algo="sha256")
[1] "25face2d475dcb2b547f85a0109ae3a506385dcb72f639af1a354220d91a9426"

Is there any way to calculate or estimate the complexity of text_short and text_long based on their hashes: text_short_hashed and text_long_hashed? Complexity could be the length.

Thanks.

Upvotes: 0

Views: 57

Answers (1)

Jon Kiparsky
Jon Kiparsky

Reputation: 7753

No. The point of a secure hash is that you can't extract any information about the original text from the hash.

Upvotes: 3

Related Questions