Linked Questions

8 votes
1 answer
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, ...
Earlz's user avatar
  • 253
1 vote
1 answer
4k 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 ...
user47508's user avatar
1 vote
0 answers
111 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 ...
Richard M. Stroup's user avatar
32 votes
3 answers
6k 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 ...
SDL's user avatar
  • 1,887
3 votes
4 answers
5k views

Would this be considered a secure password hash?

I think I've understood properly, but I want to make sure as this will involve money. Password requirement is a minimum of 16 characters and must contain one of each [Upper, Lower, Digit, Other] My ...
Peter Morris's user avatar
17 votes
4 answers
7k 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 ...
Alexandro Babonoyaba's user avatar
11 votes
3 answers
2k 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 ...
William's user avatar
  • 235
13 votes
1 answer
2k 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\...
abdolahS's user avatar
  • 439
7 votes
4 answers
2k 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 ...
Thijs Riezebeek's user avatar
5 votes
2 answers
1k 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 ...
Yanick Salzmann's user avatar
7 votes
3 answers
952 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 ...
amanusk's user avatar
  • 171
2 votes
1 answer
378 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 ...
J. Doe's user avatar
  • 453
0 votes
1 answer
2k 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 ...
azoundria's user avatar
  • 173
1 vote
4 answers
198 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?
Jack Fleming's user avatar
1 vote
1 answer
139 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).$$ ...
AmirHossein Zarei's user avatar

15 30 50 per page