Changes

Jump to navigation Jump to search
2,007 bytes added ,  23:02, March 26, 2019
SHA-2 and collisions
Line 1: Line 1: −
In [[computing]], a '''hashing algorithm''' is a computational process which takes an input of [[byte]]s and reduces it to a fixed length base64 string which is unique (within boundaries) to the input. Hashes are mainly used for data integrity, and with further asymmetrical [[algorithm]]s, digital signatures.
+
In [[computing]], a '''hashing algorithm''' is a computational process which takes an input of [[byte]]s and reduces it to a fixed length base64 string which is unique (within boundaries) to the input. Hashes are mainly used for data integrity, and with further asymmetrical [[algorithm]]s as digital signatures.  
    
== Method ==
 
== Method ==
 
Hashes are computed by churning down a large size byte array until it reaches the target size. If the initial byte array length is not divisible by the target size then the initial array is buffered with blank bits to ensure the algorithm will compute down to the target length. One important characteristic of hashing algorithms is that the hash should not be reversible.
 
Hashes are computed by churning down a large size byte array until it reaches the target size. If the initial byte array length is not divisible by the target size then the initial array is buffered with blank bits to ensure the algorithm will compute down to the target length. One important characteristic of hashing algorithms is that the hash should not be reversible.
 +
 +
==Collisions ==
 +
A hash is intended to be completely unique to a given set of bytes. However, this is not always the case.  Given enough processing effort, an identical hash can be produced using alternative input data.  This is know as a hash collision, when two pieces of data produce the same hash. It is a security risk for such collisions to be feasibly created, since original data can be replaced with alternate data, and the hash still indicates that nothing was changed.  For this reason, large key sizes are preferred for hashing, since they make it much more difficult to produce a collision.  Typically, any collision which is found would only replace valid data with gibberish. However, this is not guaranteed; given enough computing effort, it is possible to replace data is a meaningful way while still matching the hash.<br />
 +
Algorithms such as MD5<ref>https://blog.avira.com/md5-the-broken-algorithm/</ref><ref>http://cryptocrats.com/crypto/md5-the-hash-algorithm-is-now-broken/</ref> and SHA-1<ref>https://www.thesslstore.com/blog/sha-1-collision-created/</ref> have been "broken" by producing collisions.
    
== MD5 ==
 
== MD5 ==
Line 8: Line 12:  
<code>50842ef1bd9a95a284b395a0f0e0e2f8</code>
 
<code>50842ef1bd9a95a284b395a0f0e0e2f8</code>
   −
== SHA1 ==
+
== SHA-1 ==
 
SHA (Secure Hash Algorithm) is a set of functions for hashing which fixed the problems found in MD5 and has since become the industry standard. SHA1 hashes down to a 160-bit hash. For example, the text "The quick brown fox jumps over the lazy dog" would become (base64 encoded):
 
SHA (Secure Hash Algorithm) is a set of functions for hashing which fixed the problems found in MD5 and has since become the industry standard. SHA1 hashes down to a 160-bit hash. For example, the text "The quick brown fox jumps over the lazy dog" would become (base64 encoded):
 
<code>
 
<code>
1305dca26f7ef6e660c5c54948c1050cc3253b18
+
1305dca26f7ef6e660c5c54948c1050cc3253b18</code>
</code>
+
SHA-1 has been found not to have sufficient complexity to reduce collisions, so is is now disfavored.
   −
[[Category:Computers]]
+
== SHA-2==
 +
SHA-2 (typically SHA-256) is an updated version of SHA-1, which adds complexity to help reduce the chance of hash collisions.
 +
"SHA-224," "SHA-384," and "SHA-512" are also forms of SHA-2, which are using other key lengths; the trailing number states the key length in use.  The greater the key size, the more difficult it is to have a hash collision, as this produces a longer hash. For example, the text "The quick brown fox jumps over the lazy dog" using SHA-256 would produce:
 +
<code>C8554AB924067605CFEB06DE2EC69D7FAF1648EFBF027273FA4DAB8F7CED086B</code><br />
 +
 
 +
Using a 512 bit key (SHA-512), it would produce this much longer hash: 07E547D9586F6A73F73FBAC0435ED76951218FB7D0C8D788A309D785436BBB642E93A252A954F23912547D1E8A3B5ED6E1BFD7097821233FA0538F3DB854FEE6
    
==References==
 
==References==
 
<references/>
 
<references/>
 +
 +
[[Category:Computers]]
Block, SkipCaptcha, Upload, Automoderated users, Check users, delete, edit, Moderators, move, oversight, protect, rollback
19,323

edits

Navigation menu