# Partial key reveal for SHA-256 hash

Let's say I have a message 0123456789abcdefghijklmnopqrstuvwxyz which gives me the SHA-256 hash 74e7e5bb9d22d6db26bf76946d40fff3ea9f0346b884fd0694920fccfad15e33.

I want to prove to someone that I know a part of the message that hash to the hash, for example xxx34567xxxxxxxxxxxxxxx is it possible to do this? Obviously the counter party should not know what xxxxxxxxx stands for.

• Are you trying to prove that the part of the input is "34567"? I.e., are you revealing "34567" to the other party? So you actually know the rest of the key? Jan 9 '20 at 6:51
• @fgrieu If Maarten interpreted the question correctly, then the prover does not know the witness. Which is indeed a problem. Jan 9 '20 at 6:52
• @Maarten - reinstate Monica : I do not get what exactly you deem impossible, nor your reasoning after "And since..". True, the question fails to tell if the verifier initially knows the content of the segment 34567, nor if that can be revealed in the proof. But for all combinations of that, as long as the verifier knows and trusts the hash itself, and the message length is small and not confidential, I see no impossibility. Admitedly that's not possible with a black-box ideal hash, but SHA-256 is a public combinatorial function.
– fgrieu
Jan 10 '20 at 15:17
• I've removed the comment, but there are still 18 "x"-es in that question, I wonder if that's practical. I guess it's just an example though. Oh, I see that your latest question is about feasibility, and it seems feasible (?). Jan 12 '20 at 20:16