Bitcoin Forum
May 26, 2024, 12:20:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Can someone thoroughly explain what a SHA-256 function instructs?  (Read 849 times)
miffman (OP)
Legendary
*
Offline Offline

Activity: 1904
Merit: 1005


PGP ID: 78B7B84D


View Profile
July 02, 2014, 09:42:35 PM
 #1

I'm curious, but very new when it comes to cryptography and it's new components. Can someone ELI5 how exactly the function 'hashes' something?














 

 

█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
BitBlender 

 













 















 












 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
DannyHamilton
Legendary
*
Offline Offline

Activity: 3402
Merit: 4656



View Profile
July 03, 2014, 01:12:31 AM
 #2

Can someone ELI5 how exactly the function 'hashes' something?

ELY5?

No.

A 5 year old is not capable of understanding SHA-256.

Lets try something a bit less complicated than SHA-256.  We'll call it a "addemup hash".


Start with  some sort of data (perhaps a paragraph from a newspaper article).

Then we assign every character a number, A=1, a=2, B=3, b=4, C=5, c=6, etc.

Now, instead of a paragraph of words, we just have a long string of numbers.

Next step, add up all the numbers.

If the total is more than 1000, then add up all the digits in the total.

If the new total is more than 1000, then add up all the digits in the new total.

Repeat this adding process until the total is less than 1000.

Voila, we now have a "addemup hash" value.  It is guaranteed to be a number between 1 and 1000.

If someone else starts with the exact same paragraph, and follows the exact same rules, they will get the exact same "addemup hash" result.

This way they can check to see if the paragraph has changed at all.  (If I change some of the words in the original paragraph, I'll have a 998 out of 999 chance of getting a different total.  So by checking the "addemup hash" value they can determine if it is likely that the paragraph has changed.

Meanwhile, if I start with an "addemup hash" value of 639, there really isn't any good way of figuring out what the original paragraph was that was used to get that value.

Quickly and easily verified, but nearly impossible to reverse.

Now the "addemup hash" really isn't a very good hash for the purposes of bitcoin.  It has the necessary requirements of being fast and easy to generate, and difficult to reverse, but it is pretty easy for a computer to create a completely different paragraph that has the exact same "addemup hash" value.


The technical details of SHA-256 are more than I'm going to be able to explain to a 5 year old, but the important things to know are that SHA-256 has the added benefit of having more than 100,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 possible values (instead of only 999 possible values).  It also has a benefit of it being nearly impossible with any currently known mathematics to find 2 different starting "paragraphs" that result in the exact same hash value.

Ejaculation
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
July 03, 2014, 01:39:28 AM
 #3

Thanks alot for the help. I didn't know this before either and was interested, now I know it clearly and well.

Thanks again Danny!

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
ASICMINERPRISMA
                       1.4T+ ● 0.70-0.78J/GH ● ONLY 1.39BTC                          Shipping in Oct.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
miffman (OP)
Legendary
*
Offline Offline

Activity: 1904
Merit: 1005


PGP ID: 78B7B84D


View Profile
July 03, 2014, 05:09:51 AM
 #4

Great explanation! Thanks so much!














 

 

█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
BitBlender 

 













 















 












 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
Acidyo
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500


Will Bitcoin Rise Again to $60,000?


View Profile
July 03, 2014, 05:27:55 AM
 #5

I would recommend watching this video too:

https://www.youtube.com/watch?v=Lx9zgZCMqXE

Really explained well to me how everything with bitcoins work. Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!