Author

Topic: Explain SHA 256 Algorithm (Read 411 times)

jr. member
Activity: 99
Merit: 1
August 12, 2018, 04:31:10 AM
#15
Thank you so much it worked.
member
Activity: 210
Merit: 11
August 08, 2018, 08:22:04 AM
#14
It is easy for Mac users to generate SHA-256 checksum.

Via Terminal, "shasum -a 256 anyfilename.abc"
sr. member
Activity: 310
Merit: 727
---------> 1231006505
August 06, 2018, 02:17:41 AM
#13
Ok i got that,so you mean don't worry about XOR gates or anything which is used ,consider it as some function which gives you a output,am i right?

Exactly, you don't need to know exactly how it works under the hood to use it!
jr. member
Activity: 99
Merit: 1
August 05, 2018, 01:36:55 AM
#12
And i have another question why bitcoin uses double SHA256,and how does double SHA 256 compared to normal SHA256 exactly work?
This is an old dilemma as to why exactly Satoshi used double SHA256. It has likely to do with preventing possible length extension attacks:

https://crypto.stackexchange.com/questions/779/hashing-or-encrypting-twice-to-increase-security/884#884

Also check out this BCT thread devoted to this subject:

https://bitcointalksearch.org/topic/cryptographic-reasoning-for-double-hash-45456

So is it impossible to hack double SHA 256 ? because Sha 1 was tamper proof too until someone proved they were wrong.How many years can we expect double SHA256 will be reliable ?.And thanks for providing the link of thread let me have a look at it.
It has nothing to do with hacking SHA-256 (probably by hacking in your post you mean brute force attack ). The kind of attack that this double hash prevents is called length extension attack and it is something different from brute force attack. You can read more about the way this attack is done, for example, here.

i got to read it then as i knew only about brute force attack.
jr. member
Activity: 99
Merit: 1
August 04, 2018, 11:41:21 AM
#11
You don't need to know the details of the SHA-256 algorithm in order to use it. In fact, it is probably better that you not know it because if you know it, you might be tempted to implement it and make a mistake.
I couldn't agree more! I can understand you want to read up on hashing algorithms but you should never try to come up with your one solution. Instead, use a proven implementation (for example from a library) and treat it like a blackbox: you put something in and you will always get a 256 bit return.

Ok i got that,so you mean don't worry about XOR gates or anything which is used ,consider it as some function which gives you a output,am i right?
full member
Activity: 434
Merit: 246
August 04, 2018, 02:01:43 AM
#10
And i have another question why bitcoin uses double SHA256,and how does double SHA 256 compared to normal SHA256 exactly work?
This is an old dilemma as to why exactly Satoshi used double SHA256. It has likely to do with preventing possible length extension attacks:

https://crypto.stackexchange.com/questions/779/hashing-or-encrypting-twice-to-increase-security/884#884

Also check out this BCT thread devoted to this subject:

https://bitcointalksearch.org/topic/cryptographic-reasoning-for-double-hash-45456

So is it impossible to hack double SHA 256 ? because Sha 1 was tamper proof too until someone proved they were wrong.How many years can we expect double SHA256 will be reliable ?.And thanks for providing the link of thread let me have a look at it.
It has nothing to do with hacking SHA-256 (probably by hacking in your post you mean brute force attack ). The kind of attack that this double hash prevents is called length extension attack and it is something different from brute force attack. You can read more about the way this attack is done, for example, here.
sr. member
Activity: 310
Merit: 727
---------> 1231006505
August 04, 2018, 01:56:18 AM
#9
You don't need to know the details of the SHA-256 algorithm in order to use it. In fact, it is probably better that you not know it because if you know it, you might be tempted to implement it and make a mistake.
I couldn't agree more! I can understand you want to read up on hashing algorithms but you should never try to come up with your one solution. Instead, use a proven implementation (for example from a library) and treat it like a blackbox: you put something in and you will always get a 256 bit return.
sr. member
Activity: 770
Merit: 305
August 04, 2018, 12:54:39 AM
#8
So is it impossible to hack double SHA 256 ?
Nobody knows.
At least most of people in the world do not know a way to do it.
And we do not know any person who knows the hacking algorithm.
jr. member
Activity: 99
Merit: 1
August 04, 2018, 12:45:29 AM
#7
And i have another question why bitcoin uses double SHA256,and how does double SHA 256 compared to normal SHA256 exactly work?
This is an old dilemma as to why exactly Satoshi used double SHA256. It has likely to do with preventing possible length extension attacks:

https://crypto.stackexchange.com/questions/779/hashing-or-encrypting-twice-to-increase-security/884#884

Also check out this BCT thread devoted to this subject:

https://bitcointalksearch.org/topic/cryptographic-reasoning-for-double-hash-45456

So is it impossible to hack double SHA 256 ? because Sha 1 was tamper proof too until someone proved they were wrong.How many years can we expect double SHA256 will be reliable ?.And thanks for providing the link of thread let me have a look at it.
jr. member
Activity: 99
Merit: 1
August 04, 2018, 12:42:19 AM
#6
If you are looking for detailed information on the SHA-256 algorithm I suggest you read the document on Secure Hash Standard (SHS) here:
https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf

That's a 36 page PDF so a bit too long to reproduce here.

Regarding your question on double SHA-256 and how it works compared to SHA-256 itself. Double SHA-256 means you hash the value of an input using SHA-256 and you use the result from that as input for another round of SHA-256. So it's basically SHA-256(SHA-256(Message)). It's also stated in the protocol documentation:
https://en.bitcoin.it/wiki/Protocol_documentation#Hashes




Hey thank you for providing pdf link, looks like i have to study more about it. Smiley
jr. member
Activity: 99
Merit: 1
August 04, 2018, 12:40:54 AM
#5
Hi all,

Can someone explain me SHA 256 step by step mathematical operation taking an example,i want to know each step from conversion of word to ASCII code and binary code ,later right shift and all those stuffs till i get a hash.

And i have another question why bitcoin uses double SHA256,and how does double SHA 256 compared to normal SHA256 exactly work?

I want to be a blockchain developer so i need to learn all these from scratch.

Thank you

I think this is what you are looking for: Mining Bitcoin with Pencil and Paper

This video is fun to watch too: https://www.youtube.com/watch?v=y3dqhixzGVo

The double hash is simply a hash of a hash of the data. It provides extra security in certain cases.

You don't need to know the details of the SHA-256 algorithm in order to use it. In fact, it is probably better that you not know it because if you know it, you might be tempted to implement it and make a mistake.


Thanks for providing the information,it was really fun but my brain got over clocked in the middle haha btw Mining Bitcoin with pencil and paper is it still profitable in 2018 ? Haha Cheesy Cheesy
legendary
Activity: 4522
Merit: 3426
August 03, 2018, 05:09:43 PM
#4
Hi all,

Can someone explain me SHA 256 step by step mathematical operation taking an example,i want to know each step from conversion of word to ASCII code and binary code ,later right shift and all those stuffs till i get a hash.

And i have another question why bitcoin uses double SHA256,and how does double SHA 256 compared to normal SHA256 exactly work?

I want to be a blockchain developer so i need to learn all these from scratch.

Thank you

I think this is what you are looking for: Mining Bitcoin with Pencil and Paper

This video is fun to watch too: https://www.youtube.com/watch?v=y3dqhixzGVo

The double hash is simply a hash of a hash of the data. It provides extra security in certain cases.

You don't need to know the details of the SHA-256 algorithm in order to use it. In fact, it is probably better that you not know it because if you know it, you might be tempted to implement it and make a mistake.
full member
Activity: 434
Merit: 246
August 03, 2018, 11:03:47 AM
#3
And i have another question why bitcoin uses double SHA256,and how does double SHA 256 compared to normal SHA256 exactly work?
This is an old dilemma as to why exactly Satoshi used double SHA256. It has likely to do with preventing possible length extension attacks:

https://crypto.stackexchange.com/questions/779/hashing-or-encrypting-twice-to-increase-security/884#884

Also check out this BCT thread devoted to this subject:

https://bitcointalksearch.org/topic/cryptographic-reasoning-for-double-hash-45456
sr. member
Activity: 310
Merit: 727
---------> 1231006505
August 03, 2018, 10:41:56 AM
#2
If you are looking for detailed information on the SHA-256 algorithm I suggest you read the document on Secure Hash Standard (SHS) here:
https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf

That's a 36 page PDF so a bit too long to reproduce here.

Regarding your question on double SHA-256 and how it works compared to SHA-256 itself. Double SHA-256 means you hash the value of an input using SHA-256 and you use the result from that as input for another round of SHA-256. So it's basically SHA-256(SHA-256(Message)). It's also stated in the protocol documentation:
https://en.bitcoin.it/wiki/Protocol_documentation#Hashes


jr. member
Activity: 99
Merit: 1
August 03, 2018, 09:27:13 AM
#1
Hi all,

Can someone explain me SHA 256 step by step mathematical operation taking an example,i want to know each step from conversion of word to ASCII code and binary code ,later right shift and all those stuffs till i get a hash.

And i have another question why bitcoin uses double SHA256,and how does double SHA 256 compared to normal SHA256 exactly work?

I want to be a blockchain developer so i need to learn all these from scratch.

Thank you
Jump to: