Linked Questions

8
votes
1answer
2k views

Will rehashing an SHA256 hash continually, eventually produce every possible value? [duplicate]

So let's say you had infinite time and energy. You have a hashed string of some sort. Because you have infinite time and energy, you can produce a collision(or the original value) easily enough. But, ...
1
vote
1answer
3k views

How long would it take for a sha256 digest loop to reach the original hash or start cycling? [duplicate]

If I started with a sha256 hash such as 3f46fdad8e5d6e04e0612d262b3c03649f4224e04d209295ef7de7dc3ffd78a7 and rehashed it continuously (without salting): i) What ...
1
vote
0answers
105 views

SHA-2 attempts for a loop [duplicate]

Say I am hashing hashes (taking the hash of a previous hash) for an endless amount of time. How many times would it take, on average, to fall into a loop when using SHA-2 (more specifically SHA-256 ...
31
votes
3answers
5k views

Are common cryptographic hashes bijective when hashing a single block of the same size as the output?

It's been said that CRC-64 is bijective for a 64-bit block. It the corresponding statement true for typical cryptographic hashes, like MD5, SHA-1, SHA-2 or SHA-3? For example, would SHA-512 be ...
15
votes
4answers
4k views

Can we use a Cryptographic hash function to generate infinite random numbers?

I have seen that there are PRNG that can generate a specific number of random-numbers. The Mersenne Twister as an example, can generate 2**19937 (if I'm not wrong) but... can we use a cryptographic ...
11
votes
3answers
1k views

Smallest Guaranteed hash collision cycle length

If I take the sha-256 of an empty string, and apply the hash function $2^{256}!$ times, will I end up with the same hash that I started with? Is the smallest required cycle equal to the LCM of $1$ to ...
11
votes
1answer
1k views

Why does HMAC use two different keys?

Suppose $H$ is a hash function; why is $$H(k\mathbin\|H(k\mathbin\|m))$$ not secure? See this HMAC definition. In there, indeed two keys are used and the mac algorithm is $$H(k_1\mathbin\|H(k_2\...
6
votes
4answers
1k views

How many recursive md5 hashes are needed to always get same string

If we start with a set of possible input values, and apply the md5 algorithm to all elements of this set and then filter out the unique results (a.k.a. filter out ...
5
votes
2answers
653 views

Extending the size of input for SHA-2 function

In the question Does a hash function necessarily need to allow arbitrary length input? many answers talk about the theoretical limit of the SHA-2 functions being $2^{64} - 1$ bit due to padding. I was ...
6
votes
3answers
569 views

How to prove that finding a cycle in a cryptographic hash function is hard?

I want to show that finding cycles in a cryptographic hash function is hard. My thought: assume there a black box, that given a cryptographic hash function $h$, finds some $x$ and $r$ in polynomial ...
2
votes
1answer
235 views

Any theory about period length for AES applied to itself?

For example AES-128 starting with a 128-bit message $m_0$ and static 128 key $k$ $AES128(m_0,k)\rightarrow c_0$ $c_0\rightarrow m_1$ $AES128(m_1,k)\rightarrow c_1$ $c_1\rightarrow m_2$ ... continue ...
0
votes
1answer
661 views

Is there a SHA-256 value which hashes to itself? [duplicate]

Getting curious about SHA-256 cycles (what happens if you hash a value repeatedly), I came across this question: Cycles in SHA256 The first answer suggests that using a 7-bit hash, it's possible to ...
1
vote
4answers
164 views

If you iterate a cryptographic permutation long enough will you map the input to itself?

Given a cryptographic permutation $\{0,1\}^n \rightarrow \{0,1\}^n$ does it follow that after some number of iterations you must eventually map the input to itself?
1
vote
1answer
100 views

Can I retrieve a re-hashed (hash) value, for instance by additional hashing?

I have a double-SHA-256 of some text $$ h_2 = \operatorname{SHA256}(\operatorname{SHA256}(m)).$$ I don't need the plain text ($m$), but somehow I need to get first $$h_1 = \operatorname{SHA256}(m).$$ ...
0
votes
0answers
14 views

Can a hash function be cyclic? [duplicate]

Is it possible for a hash function, SHA256 for example, to be a cyclic hash function, where the hash of the hash returns the original value? Example: ...