 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
02-11-2008, 01:08 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 136
Thanks: 4
|
MD5 or SHA1?
Hey,
What would be the best encryption algorithm to use?
I know / think that if I use both conflictions occur, but am not sure which is better to use!
Gareth
|
|
|
|
02-11-2008, 01:35 PM
|
#2 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
I use sha1, I believe its better encrypted but I'm not positive.
|
|
|
|
02-11-2008, 03:14 PM
|
#3 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
|
MD5 has chances of collision, and is a lighter weight hash. While SHA1 does have potential collisions, they are all theoretical at this stage. SHA1 is a military-grade hash algorithm.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
|
|
|
|
02-11-2008, 06:43 PM
|
#4 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
Quote:
Originally Posted by RobertK
MD5 has chances of collision, and is a lighter weight hash. While SHA1 does have potential collisions, they are all theoretical at this stage. SHA1 is a military-grade hash algorithm.
|
That last part is inaccurate, they use 256 bit encryption. Though I believe (without proof) that the military and government agencies use algorithms not available commercially.
|
|
|
|
02-11-2008, 07:22 PM
|
#5 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
|
Of course, but SHA1 was designed by military-grade sources and released to the public after a time. Hashes are simply used for encryption, they do not themselves provide encryption. Hence the freedom to give secure hashes. The encryption algorithm is more important than the hash in cryptology, as a poor cipher will mathematically reveal the hash.
Quote:
|
The original specification of the algorithm was published in 1993 as the Secure Hash Standard, FIPS PUB 180, by US government standards agency NIST (National Institute of Standards and Technology). This version is now often referred to as SHA-0. It was withdrawn by the NSA shortly after publication and was superseded by the revised version, published in 1995 in FIPS PUB 180-1 and commonly referred to as SHA-1. SHA-1 differs from SHA-0 only by a single bitwise rotation in the message schedule of its compression function; this was done, according to the NSA, to correct a flaw in the original algorithm which reduced its cryptographic security. However, the NSA did not provide any further explanation or identify what flaw was corrected. Weaknesses have subsequently been reported in both SHA-0 and SHA-1. SHA-1 appears to provide greater resistance to attacks, supporting the NSA’s assertion that the change increased the security.
|
SHA hash functions - Wikipedia, the free encyclopedia -- SHA-0 and SHA-1
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
|
|
|
|
02-11-2008, 07:29 PM
|
#6 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
About MD5;
Quote:
|
Originally Posted by Wikipedia
In 2004, more serious flaws were discovered making further use of the algorithm for security purposes questionable.
|
Quote:
|
Originally Posted by Wikipedia
The use of MD5 in some websites' URLs means that Google can also sometimes function as a limited tool for reverse lookup of MD5 hashes.[12] This technique is rendered ineffective by the use of a salt.
|
Therefor I choose SHA1 to encode my strings with. I think RobertK quoted it quite well.
MD5 - Wikipedia, the free encyclopedia
Salt (cryptography) - Wikipedia, the free encyclopedia
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
02-11-2008, 10:40 PM
|
#7 (permalink)
|
|
The Addict
Join Date: Nov 2007
Posts: 264
Thanks: 2
|
Wait until quantum encryption picks up.
|
|
|
|
02-19-2008, 05:57 AM
|
#8 (permalink)
|
|
The Acquainted
Join Date: Sep 2007
Posts: 126
Thanks: 4
|
Wasn't SHA1 cracked by some Chinese professor? Can't remember, but some programmer who use to work for me showed me some article. Let me try and digg it up. Same goes for MD5.
Here we go: The Epoch Times | Chinese Professor Cracks Fifth Data Security Algorithm
|
|
|
|
|
The Following 2 Users Say Thank You to Sam Granger For This Useful Post:
|
|
02-19-2008, 06:21 AM
|
#9 (permalink)
|
|
The Acquainted
Join Date: Nov 2007
Posts: 154
Thanks: 31
|
Thanks for the link, Sam. I know I had read that awhile back as well. I think for most applications SHA1 will be fine for awhile (esp. when used with a salt). I've used MD5, SHA1 and SHA256 in various applications, with rijndael-256 (AES) in one. As long as you're not storing sensitive data you're fine. I don't think prof. Wang Xiaoyun is that interested in getting into your blog.
__________________
I reject your reality, and substitute my own.
|
|
|
|
02-19-2008, 11:01 AM
|
#10 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
As well as SOCK, thanks for the link Sam. You're on a roll at the moment aren't you?
I've triple encoded my passwords with SHA1 and MD5. Since you'll mostly only use it when loggin in and registering, it won't slow the site down tremendously. Plus, I am using SALT so I'll be fine for a couple of years.
But, the time for change is near. Hopefully PHP will incorporate it into their new PHP 6 or above, but upgrade PHP 4 and 5 with it as well. (since more programs still depend on 4.4.8)
Once again, thanks!
The solution for now is, use it in conjunction. SHA1, MD5 and SALT put together offer a great deal of security.
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
02-20-2008, 12:08 AM
|
#11 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 136
Thanks: 4
|
In fact, ReSpawn, I read an article which says that SHA1 and MD5 put together wasn't secure at all; because it increases collisions!
|
|
|
|
02-28-2008, 12:28 AM
|
#12 (permalink)
|
|
The Wanderer
Join Date: Feb 2008
Posts: 18
Thanks: 0
|
Just because I can't find the answer to this question myself, I just:
sha1(md5($string));
:)
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|