Skip to main content
Post Merged (source) to crypto.stackexchange.com/questions/24623/cycles-in-sha256
Post Locked by e-sushi
Post Closed as "Duplicate" by yyyyyyy, e-sushi
deleted 6 characters in body; edited title; added 13 characters in body
Source Link

SHA-2 probability ofattempts for a loop

Say I am hashing hashes (taking the hash of a previous hash) for an endless amount of time.

What is the probability that I willHow many times would it take, on average, to fall into a loop when using SHA-2 (more specifically SHA-256 and SHA-512), like such:

original text = z (can be any string)
hash z = b
hash b = c
hash c = d

...

hash n = b (restarting loop)

or more literally,

original text = "test"
SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
SHA-256 of "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" = "7b3d979ca8330a94fa7e9e1b466d8b99e0bcdea1ec90596c0dcc8d7ef6b4300c"

...

SHA-256 of n = SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"

WhichHow many attempts, on average, would be the probability of this happeningtake?

SHA-2 probability of loop

Say I am hashing hashes (taking the hash of a previous hash) for an endless amount of time.

What is the probability that I will fall into a loop when using SHA-2 (more specifically SHA-256 and SHA-512), like such:

original text = z (can be any string)
hash z = b
hash b = c
hash c = d

...

hash n = b (restarting loop)

or more literally,

original text = "test"
SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
SHA-256 of "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" = "7b3d979ca8330a94fa7e9e1b466d8b99e0bcdea1ec90596c0dcc8d7ef6b4300c"

...

SHA-256 of n = SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"

Which would be the probability of this happening?

SHA-2 attempts for a loop

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 and SHA-512), like such:

original text = z (can be any string)
hash z = b
hash b = c
hash c = d

...

hash n = b (restarting loop)

or more literally,

original text = "test"
SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
SHA-256 of "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" = "7b3d979ca8330a94fa7e9e1b466d8b99e0bcdea1ec90596c0dcc8d7ef6b4300c"

...

SHA-256 of n = SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"

How many attempts, on average, would this take?

Source Link

SHA-2 probability of loop

Say I am hashing hashes (taking the hash of a previous hash) for an endless amount of time.

What is the probability that I will fall into a loop when using SHA-2 (more specifically SHA-256 and SHA-512), like such:

original text = z (can be any string)
hash z = b
hash b = c
hash c = d

...

hash n = b (restarting loop)

or more literally,

original text = "test"
SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
SHA-256 of "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" = "7b3d979ca8330a94fa7e9e1b466d8b99e0bcdea1ec90596c0dcc8d7ef6b4300c"

...

SHA-256 of n = SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"

Which would be the probability of this happening?