As the title says: do we know already for sha256 what input would yield the same output as when using no input at all?

  • 1
    $\begingroup$ The empty string ≠ no input. $\endgroup$ – fkraiem Aug 15 '17 at 9:29
  • 6
    $\begingroup$ Two distinct inputs with the same output is a collision. We know of no collisions in SHA-2. (in practice it'd even amount to a second pre-image, which we can't even construct for MD5) $\endgroup$ – CodesInChaos Aug 15 '17 at 9:40

Semantically, this makes no sense.

A function $\ f : X \to Y$, always takes an input from $X$ (by definition of a function).

In the case of $SHA256$ the set of possible inputs is the list of all possible bit strings, including the empty string denoted as $\epsilon$ :

$X = \{\\ \epsilon,\\ \texttt{0b0},\\ \texttt{0b1},\\ \texttt{0b00}\\ \texttt{0b01},\\ \texttt{0b10},\\ \ldots\}$

Remark: this is not a finite set.

As a result, there is no such thing as no input at all.

If your question is

Do we know $x$ such that $SHA256(x) = SHA256(\epsilon)$ where $\epsilon$ is the empty string ?

Then the answer is no, because this is called a collision ($x \neq y \land h(x) = h(y)$) and none has been found (yet) for SHA256.

  • 2
    $\begingroup$ I have seen the empty string denoted $\lambda$, $\epsilon$, or $\varepsilon$, but never $\sigma$... $\endgroup$ – fkraiem Aug 16 '17 at 7:48
  • 2
    $\begingroup$ SHA-2 is defined for all bit strings, the length doesn't need to be a multiple of 8 bits. $\endgroup$ – user31573 Aug 16 '17 at 16:48
  • 2
    $\begingroup$ Oh, sure, it's an unrelated thing, but I'd really like to see people get this correctly. $\endgroup$ – user31573 Aug 16 '17 at 17:14
  • 4
    $\begingroup$ By the way, strictly speaking, SHA-256 is limited to 2⁶⁴-1 bits, so the set of all inputs is finite. $\endgroup$ – user31573 Aug 16 '17 at 17:16
  • 2
    $\begingroup$ I won't bother with correcting that one :) $\endgroup$ – Biv Aug 16 '17 at 17:19

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.