user_input, how can I find some information about the constant value of
I give the known prefix of
stackexchange, and the backend secret of
107983 (as a string) for this demonstration. You can only change
user_input="question" KNOWN_PREFIX="stackexchange" backend_secret="107983" # bf24cd561d758104993d3fe6f58b44e6209c7bcd printf "%s%s%s" "$KNOWN_PREFIX" "$user_input" "$backend_secret" | sha1sum
Excerpts from the answer where I try to follow along:
The probe is obvious, we query for both
known_prefix + user_input = A (less the last byte), and
known_prefix + user_input = B (less the last byte)[where
sha1(A) = sha1(B)].
To do this, SHA-1 would need to already be broken? Is it saying we need to find
sha1(known_prefix + user_input + backend_secret), where
user_input can be anything?
If the first byte of
backend_secretwas the common last byte of
B, then the results of the two queries are the same (and hence we have learned the first byte of backend_secret)
backend_secret is not known to us, and cannot be changed. The last byte of
B is the last byte to
sha1(A) = sha1(known_prefix + user_input + backend_secret)). Is the answer saying this can happen if
backend_secret is chosen poorly by the backend? Does
backend_secret need to be of a specific size?
If they are different, we have learned what the first byte of
backend_secretwas not (and we can try again with a different collision with a different final last byte).
backend_secret is a constant, how can we "try again with a different final last byte"?