If I were omnipotent and wanted people to believe in me, I would write a book that hashes to 0, so that anyone could verify its authenticity.
Show HN: SHA-256 explained step-by-step visually
31–40 of 145 posts
Re: Show HN: SHA-256 explained step-by-step visually
#32Re: Show HN: SHA-256 explained step-by-step visually
#33Can it be proven whether values of m exist such that SHA256(m) == 0? If I were omnipotent and wanted people to believe in me, I would write a book that hashes to 0, so that anyone could verify its authenticity.
Re: Show HN: SHA-256 explained step-by-step visually
#34Earlier quoted context omitted.
If such a movie even mentions SHA-256 I think that's above average on its own.
That depends.. "Just a second, I need to backdoor the SHA256 rootkit to penetrate the directory. Shit, they have an X62 firewall. Luckily I brought my pentester."
Re: Show HN: SHA-256 explained step-by-step visually
#35A couple of details missing from this visualization are how you pad a message to be a multiple of the block size, and how you chain blocks together to form a longer message. In the pseudocode at https://en.wikipedia.org/wiki/SHA-2#Pseudocode, that's the "Pre-processing (Padding)" part and the "for each chunk" loop just below it. I get why you'd want to leave those things out, since they're not really the interesting part, and the screen is already pretty packed as it is.
If anyone's feeling curious about implementing this yourself, take a look at these project notes: https://github.com/oconnor663/applied_crypto_2021_fall/tree/.... At some point I'll clean that up for public consumption, but for now just ignore the parts about grades and cheating :)
Re: Show HN: SHA-256 explained step-by-step visually
#36Re: Show HN: SHA-256 explained step-by-step visually
#37Re: Show HN: SHA-256 explained step-by-step visually
#38Can it be proven whether values of m exist such that SHA256(m) == 0? If I were omnipotent and wanted people to believe in me, I would write a book that hashes to 0, so that anyone could verify its authenticity.
You could in theory also get that with a lot of computation of course
Maybe an omnipotent cryptographer would find flaws in SHA-256, but then they could design a better function and include it in the book.
Re: Show HN: SHA-256 explained step-by-step visually
#39So, how do people come up with these things? I assume every aspect of the design is carefully considered to defend it against various attacks. For example, why "right rotate 7 XOR right rotate 18 XOR right shift 3" and not "right rotate 2 XOR right rotate 3 XOR right shift 4"?
I did wonder why initialization is like:
1. Initialize hash value h0 to h7: first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19).
2. Initialize array of K constants: first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311
Re: Show HN: SHA-256 explained step-by-step visually
#40Oh this is great. When we taught SHA-256 last semester, we linked to this YouTube video: https://youtu.be/f9EbD6iY9zI . Next time we do it, we'll probably link to both. Having several different ways to visualize the same thing is very helpful, and I like that this one moves quickly. A couple of details missing from this visualization are how you pad a message to be a multiple of the block size, and how you chain bloc…
The "for each chunk" is also implemented (which was one of the most difficult parts to synchronize with the UI), but I agree too, I should come up with some way to represent it better. Thanks again :)