Live data from Hacker News

Show HN: SHA-256 Animation

github.com

71–80 of 105 posts

Re: Show HN: SHA-256 Animation

#71
post #53

Earlier quoted context omitted.

There's a few things in there that are factually incorrect -- in particular, the false notion that "every input has a unique output" can be quite dangerous in some cryptographic settings. That said, the purpose of this talk is about the mechanics of the function, and not its properties or how to use it safely. So don't let that detract from what is, really, an awesome presentation.

I'm sorry, could you please elaborate? I was always under the assumption that hash functions have to be deterministic, and thus, that "every input has a unique output" was a correct statement. AFAIK the contrary is invalid, so that "not every output is the result of one and only one input".

A function being deterministic means that any input will have a single output. But it is not unique for any hash function, SHA-256 included. The definition of a hash function is any function which takes an arbitrary length input and outputs an n-bit output for some fixed value of n. By virtue of the fact that you have infinite inputs and finite outputs, the outputs cannot be unique.

Generally when people make this claim, what they're actually referring to is what's called Collision Resistance (CR) and/or Weak Collision Resistance (WCR), which instead make claims on difficulty of finding such collisions (of which infinitely many exist).

WCR, necessary for almost any cryptographic use, states that for any given input it should be difficult to find a different input which hashes to the same value. CR, generally desirable for cryptographic hash functions, states that it should be difficult to find two different inputs such that their hashes are equal. CR implies WCR, but WCR does not imply CR -- for example, SHA-256 (currently) exhibits CR but SHA-1 only exhibits WCR.

Re: Show HN: SHA-256 Animation

#72
post #64

Earlier quoted context omitted.

There are 2^256 potential outputs for SHA-256, while the number of potential inputs is infinite. Therefore, the same output can be generated with different inputs, although finding such "collisions" by chance is extremely unlikely

The claim is not that every output has a unique input, which would not be correct, and seems to be what you are addressing.

I see what you mean, but it sounds like the output is unique, and we probably agree that in this field you need to use sentences that cannot be easily misinterpreted.

Re: Show HN: SHA-256 Animation

#73
post #51
post #46

Earlier quoted context omitted.

You need to watch his video, very cool, it really helps to understand how this works: https://www.youtube.com/watch?v=f9EbD6iY9zI

That video is really, really awesome! And it won't leave you feeling "Japanese" either. (Which is a great people, btw. I'd really like to go there someday, mostly for the food and language and history. And Anime also, I'm forced to admit.)

You guys really need to chill out. If you've got something to say, then say it.

Re: Show HN: SHA-256 Animation

#74
post #66

I remember that in my first year of CS, the professor asked us to implement this algorithm. We had just learned our first computer language(C by the way). Result: nobody was able to do it, and everybody got a 10 after the professor realized it.

Hehehe, yea, no, there's a good five to ten steps necessary to grok all that.

Re: Show HN: SHA-256 Animation

#76
post #23
post #2

I wanted to understand how SHA-256 works, so I made a terminal animation that shows the bitwise operations at each step. I wrote a text guide in the README.md to explain what's going on. I think my technical terminology is okay. I'm new to hash functions though, so I don't yet know why SHA-256 has been designed in the way it has (e.g. why exact numbers were chosen in the bitwise rotations). As far as I understand, th…

1) I loved this video. 2) I did have to take a sip of tea and think about my life when I realised I was watching a video by a Welshman about mining. 3) Although having said this, 'Welsh Bitcoin Miner' is going to fit seamlessly into my West Country themed cyberpunk adventure 'Cider Punk'.

I feel like this is some sort of James Watt reference but I can't be sure.

Re: Show HN: SHA-256 Animation

#77
post #73
post #51

Earlier quoted context omitted.

That video is really, really awesome! And it won't leave you feeling "Japanese" either. (Which is a great people, btw. I'd really like to go there someday, mostly for the food and language and history. And Anime also, I'm forced to admit.)

You guys really need to chill out. If you've got something to say, then say it.

I think you're being down-voted because your comment doesn't really add anything to the discussion at hand.

Re: Show HN: SHA-256 Animation

#79
post #27

I feel like there are lots of mathematical / programming concepts that could be explained through animation. Anyone got any good examples?

3blue1brown is great, e.g. his Fourier transform animation is super intuitive: https://youtube.com/watch?v=spUNpyF58BY He has opensourced his animation engine "manim" used in his videos: https://github.com/3b1b/manim

Thank you for showing me that Fourier transform video. I've never understood how it worked because usually they just show the integral and call it good.

Re: Show HN: SHA-256 Animation

#80
post #70
post #64

Earlier quoted context omitted.

The claim is not that every output has a unique input, which would not be correct, and seems to be what you are addressing.

at 1:08 in the video, that is exactly what he claims: "So every piece of data in the world has its own unique hash digest." This is false for the reasons apeescape describes: every piece of data in the world has its own hash digest, but these hash digests are not unique.

On the other hand, if we can count "every piece of data in the world" then we can estimate the probability of having a collision.
Post reply on HN