Score:0

Is it possible to get the SHA256 hash collision with partial known data

br flag

I have a text sentence that consists of 448 digits [0-9] [a-f] (in HEX format).

This text sentence is partially cut off, but I know the middle, and the beginning and end are damaged.

What I know is 322 known digits in the middle of a text sentence.

74 unknown digits at the beginning

52 unknown digits at the end

That is, the entire text Size: 224 bytes and it is hashed using the SHA256 hash algorithm I know of.

Is it possible to simplify the search for the same hash in this case? (simplify brute force)

Is it possible to stumble upon a collision of this hash since I know 322 known digits in the middle of the text?

Dew Debra avatar
br flag
@fgrieu Sorry for the incorrect question, I corrected it. However, as far as brute force is concerned, is it possible to simplify the search for the hash in the case of the known 322 known digits in the middle of the text? The text itself is 448 digits [0-9] [a-f] (in HEX format)
kelalaka avatar
in flag
What is the origin of this question? Why did you have some partial information about the message?
Score:1
nl flag

No, there's no easier way than to just try brute force.

A hash is constructed deliberately in such a way that even two very close inputs can produce two very different hash outputs. That property is known as the avalanche effect.

Is it possible to stumble upon a collision of this hash since I know 322 known digits in the middle of the text?

Also no, there are no known SHA256 collisions (yet).

Score:0
ng flag

I'll read the question as:

From a 224-byte text, we know from a hex dump all excepts the first 37 bytes and the last 26 bytes, which are damaged. We also know the (32-byte) SHA-256 of the text. How can we find the full text, or a full text with the same hash?

As the existing answer implies, the hash does not directly allow to find

  • What's missing: SHA-256 is preimage-resistant. Also we miss 63 bytes, the hash only gives 32, thus we can expect that about $256^{31}$ combinations of the missing bytes lead to the hash.
  • Something else that provides the same hash: SHA-256 is collision-resistant.

However, the statement's « text sentence » could mean that the 224 bytes have high redundancy, e.g. use a recognizable language and encoding. Also, the statement's « damaged » would mean there is some useful information that can be scavenged, helping a guess. That might allow to guess the full message from the known center part and the garbled extremities, or reduce the possibilities to few enough candidates that each can be hashed. And then the hash allows to reliably test an hypothesis: if a guess passes the hash test, it must be the right guess, since SHA-256 is collision-resistant.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.