0
$\begingroup$

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?

$\endgroup$
2
  • $\begingroup$ @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) $\endgroup$
    – Dew Debra
    Oct 14 at 12:35
  • $\begingroup$ What is the origin of this question? Why did you have some partial information about the message? $\endgroup$
    – kelalaka
    Oct 14 at 16:17
1
$\begingroup$

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).

$\endgroup$
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.