Home Private Messages Search
CPG Dragonfly™ CMS stopsoftwarepatents.eu petition banner
Toggle Content
 
Forums ⇒ CMS (All) ⇒ Security :: Archives ⇒ md5 vs sha1 :: Archived


md5 vs sha1 :: Archived
Post any security related questions in here.
Please send discovered reports to security @ cpgnuke.com
Do Not post links to exploits or hacker sites - your post will be edited/deleted.
If you think you've been hacked, FIRST go through your server logs.

Go to page 1, 2  Next
Post new topic    Revive this topic    Printer Friendly Page     Forum Index ⇒  Security

Topic Archived View previous topic :: View next topic  
Author Message
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Wed May 19, 2004 6:32 pm
Post subject: md5 vs sha1

Somehow it seems people think they are more secure by using SHA1 hashes instead of the default MD5 for the passwords.

Now someone created PHP files to create SHA1 hashes and released that into phpnuke 7.1
That is a bit bloated and a bloat to the system.

Ofcourse the CPG-Nuke people know better ways like using PHP 4.3.x
PHP 4.3.x already has SHA1 encoding build in so why use bloated material ?

Now there's 2 problems:
- current passwords
- lacking servers that didn't upgrade their PHP versions

There are 2 ways to solve the passwords problem:
- sha1() the md5 strings
- create new password for each user in sha1() and email that to everyone

There are 2 ways to solve the PHP version problem:
- force servers to upgrade their software or move to a better host
- let the system autodetect PHP version and switch md5/sha1

Benefit of sha1:
- stronger encryption
- takes longer to decrypt for hackers

So i was thinking of doing sha1() over the md5 if version is 4.3.x like this
PHP:
$pass = md5($password);
if (
function_exists('sha1') ) $pass = sha1($pass);

Also there are mor features like mhash or sha1lib
PHP:
But those will only work if the libraries are installed: mhash.sourceforge.net/

So should we implement this or not ?


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS


Last edited by DJ Maze on Sat Jan 15, 2005 4:56 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
alexm
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Apr 20, 2004
Posts: 574
Location: Lafayette, LA USA
PostPosted: Wed May 19, 2004 7:02 pm
Post subject: Re: md5 vs sha1

DJMaze wrote:
Now someone created PHP files to create SHA1 hashes and released that into phpnuke 7.1
That is a bit stupid and a bloat to the system.
What else is new? Smile

DJMaze wrote:
There are 2 ways to solve the passwords problem:
#1 - sha1() the md5 strings
#2 - create new password for each user in sha1() and email that to everyone

#1 = Smile
#2 = Sad

DJMaze wrote:
There are 2 ways to solve the PHP version problem:
#1 - force servers to upgrade their software or move to a better host
#2 - let the system autodetect PHP version and switch md5/sha1
#1 = Sad
#2 = Smile

DJMaze wrote:
So should we implement this or not ?

It definitely sounds do-able. I'd do it.

It'd be my preference that MD5 / SHA1 hashes be configurable. Otherwise you have the person who's shared host upgrades their PHP overnight getting screwed.

If it's configurable (one way, of course)... It's up to the admin to decide when is the best time to switch over if they are upgrading.

...


alexm's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Shared Host / Linux / Apache 1.3.23 / Mysql 3.23.58 / PHP 4.3.3 / CPG 8.2b & 8.3CVS
Back to top
View user's profile Visit poster's website Photo Gallery
NEMINI
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 4551

PostPosted: Wed May 19, 2004 8:44 pm
Post subject: Re: md5 vs sha1

I think autodetection is the key, many people won't even know the difference between one or the other (like me lol) Unfortunately most things need to be 'dumbed-down' or automated so the unknowing user can still use it.

_________________
NEMINI.org, NEMINI.us, NEMINI.info, NYMINI.org

NEMINI's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
1.3.34 (Unix)/4.1.18-standard/4.4.2 /9.1.0.8 CVS
Back to top
View user's profile Visit poster's website Photo Gallery
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Wed May 19, 2004 9:41 pm
Post subject: Re: md5 vs sha1

Hmm what about a button Question

On clean install it asks if you want to use stronger password encryption or not.
And a warning that when you switch hosts they have to run atleast PHP 4.3.0

In admin main_settings a button that converts all passwords if you want to switch.

Ofcourse the "feature" will only be shown if the function exists.

And if you use the stronger encryption we hardcode the setting so you can't switch back.
Ofcourse when you manualy modify the hardcode setting a backup check is done on admin login to check if you messed with it.

_________________
There are two paths, the short one and the long one.
When you choose the short path you will notice it takes longer then the long path.
So READ the FAQ and Wiki first Razz

DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
NEMINI
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 4551

PostPosted: Wed May 19, 2004 9:48 pm
Post subject: Re: md5 vs sha1

sounds just about right Maze Smile

_________________
NEMINI.org, NEMINI.us, NEMINI.info, NYMINI.org

NEMINI's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
1.3.34 (Unix)/4.1.18-standard/4.4.2 /9.1.0.8 CVS
Back to top
View user's profile Visit poster's website Photo Gallery
Jeruvy
Security Team
Security Team

Offline Offline
Joined: Apr 23, 2004
Posts: 1432
Location: Canada
PostPosted: Wed May 26, 2004 4:38 pm
Post subject: Re: md5 vs sha1

How do you propose:

Quote::
DJMaze wrote:
#1 - sha1() the md5 strings

_________________
J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Jeruvy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}
Back to top
View user's profile ICQ Number Yahoo Messenger Photo Gallery
djdevon3
Gold Supporter
Gold Supporter

Offline Offline
Joined: Aug 05, 2004
Posts: 4363

PostPosted: Sat Aug 07, 2004 8:03 pm
Post subject: Re: md5 vs sha1

I've never heard of sh1. Offshoot of md5?


djdevon3's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33/4.4/4.3.11
Back to top
View user's profile Visit poster's website Photo Gallery
Victor
Nice poster
Nice poster

Offline Offline
Joined: Dec 06, 2004
Posts: 69
Location: Mexico/Italia
PostPosted: Sat Jan 15, 2005 4:10 pm
Post subject: Re: md5 vs sha1

Boath encodings are bad.

MD5 is hacked in a 5 minutes if is already in MD5 database. Otherway good hecker need about and hour to find a code. So MD5 is not good. Think about if MS will use MD5 for their security codes. BIG DISASTER


Victor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
win/linux/2.0.52/4.0.22/4/dragonfly
Back to top
View user's profile Visit poster's website
Jeruvy
Security Team
Security Team

Offline Offline
Joined: Apr 23, 2004
Posts: 1432
Location: Canada
PostPosted: Sat Jan 15, 2005 4:17 pm
Post subject: Re: md5 vs sha1

A. Victor is correct that neither are terribly effective in today's computing environments.

B. But this is the issue, neither are encryption solutions on their own, they are simply hashing methods.

C. Regardless of the cracking ability of todays md5 crackers (of which an entire culture has formed around) neither is required to be 'secure' in the real world, or in many (or should be many) 'good' applications in the market. This thread was a discussion ages ago about whether one should use one over the other and most perceived benefits where not substantial.

Epilogue. I think that using multiple hashing methods can improve the randomness.

_________________
J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Jeruvy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}
Back to top
View user's profile ICQ Number Yahoo Messenger Photo Gallery
rick_deckard
Nice poster
Nice poster

Offline Offline
Joined: Mar 12, 2005
Posts: 73

PostPosted: Thu Mar 17, 2005 8:52 pm
Post subject: Re: md5 vs sha1

Old thread, but new user, so I didn't see this when it was active.

MD5 is getting less and less secure. Professor Wang in China and her team succeeded in finding collisions algorithmically (previously people only found pseudo-collisions or they foudn collisions via brute force).

This means that, whether in a lookup table or not, her team can find a collision of an arbitrary MD5 hash in under an hour.

They achived similar results with SHA-1.

I agree that these hashes are not real security. I'm brand new to the Nuke world, but I would guess that most Nuke users are sending logins in plain text anyway with no SSL layer, so you're not typically talking about highly secure systems. If you have high-value data and you're already using SSL and are still dependent on MD5 or SHA-1 for signatures, though, it seems like there is a notable and increasing risk.

Anyway, there's some good reading on the Wang results at the following pages:

The relatively hardcore version (beyond me): eprint.iacr.org/2004/199.pdf

The version for regular folks: www.pgp.com/library/ct...ashes.html

Related news story:
www.pgp.com/news/sha1.html


rick_deckard's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD with Win2K for dev/1.3.23/4.0.22/4.3.10/9.0.1
Back to top
View user's profile Visit poster's website
tank
Gold Supporter
Gold Supporter

Offline Offline
Joined: Apr 20, 2004
Posts: 824
Location: Houston, Texas USA
PostPosted: Fri Oct 07, 2005 1:09 pm
Post subject: Re: md5 vs sha1

Bringing this back up.

Just wondering on what the current thoughts are from switching from MD5.

With the current trend of creating MD5 Hash databases and brute force scripts that are run on nice powerful servers the threat is just increasing. I just got through reading through a site that has over 12,408,249 unique Hashes to compare against. Mainly all words, and noun type objects. Also recently was on a site that claimed that a 8 character alpha-num password could be brute forced in under 30 minutes.

In my opinion this is due to the popularity of using MD5 across the PHP programming board. All technical issues aside, just by using SHA1() we would eliminate this popularity effect and increase the security even more. MD5 will continue to be i the public eye until the server hardware is there to brute force passwords in seconds. All it takes is some one with more resources than time. At that point anything hashed through MD5 will be deemed unsecure and we will HAVE to do something then.

There are several workarounds and things people do to beef up the MD5 hashes such as adding salts or adding random characters to the MD5 hash that is stored and then removing them throgh the script, but nonw of these will work as long as the project has the source available for people to view.

Just looking for thoughts on this because at some point DragonFly will have to address this issue.

_________________
Search is your friend

tank's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora Core 1, Apache 1.3.33, Mysql 4.1.14, PHP 5.0.5 w/ APC cache, Dragonfly 9.0.6.1
Back to top
View user's profile Visit poster's website
darkgrue
Developer
Developer

Offline Offline
Joined: Apr 20, 2004
Posts: 542
Location: Lancaster, CA
PostPosted: Fri Oct 07, 2005 6:46 pm
Post subject: Re: md5 vs sha1

OK, really we're approaching Halloween and all, but necro-posting to a cryptography thread... =/

tank wrote:
Bringing this back up.

Just wondering on what the current thoughts are from switching from MD5.

Arise thread, and LIVE! No, not really. This thread died a natural death a while ago, for a number of really good reasons, not just old age.

tank wrote:
With the current trend of creating MD5 Hash databases and brute force scripts that are run on nice powerful servers the threat is just increasing. I just got through reading through a site that has over 12,408,249 unique Hashes to compare against. Mainly all words, and noun type objects. Also recently was on a site that claimed that a 8 character alpha-num password could be brute forced in under 30 minutes.

All cryptographic hashes, now, and in the future, are vulnerable to dictionary attacks. Increasing computing power and the size (and cost) of massive storage decreasing, it's now feasible to precompute large (if not comprehensive) dictionaries. In which case you just find the cyphertext and look up the plaintext, takes no time at all. This is just as true of MD5 as SHA-1. Which is why such algorithms are generally used with a [url=http://en.wikipedia.org/wiki/Salt_(cryptography)]salt[/url] to extend the seach space.

tank wrote:
In my opinion this is due to the popularity of using MD5 across the PHP programming board. All technical issues aside, just by using SHA1() we would eliminate this popularity effect and increase the security even more.

You are not only advocating security by obscurity, which is a FALSE premise to begin with. SHA-1 is a technical revision of SHA (FIPS 180), and it has seen heavy use in the U.S. Federal Government, as well as in commercial applications. It is not obscure or less popular by any means!

You also glossed over rick_deckard's reply just prior to yours, where he mentions the research team of Xiaoyun Wang, Yiqun Lisa Yin, and Hongbo Yu (mostly from Shandong University in China) have "broken" the SHA-1 algorithm. This is not an esoteric hypothetical attack with a very narrow applicability, it's a serious break in the algorithm. If you believe that MD5 is worthless as a protective measure (it is not) replacing it with one with an acknowledged serious flaw is extremely poor logic, especially if you reason that the popularity of the algorithm is its primary protective value!

tank wrote:
There are several workarounds and things people do to beef up the MD5 hashes such as adding salts or adding random characters to the MD5 hash that is stored and then removing them throgh the script, but nonw of these will work as long as the project has the source available for people to view.

/sigh OK, you're way off now... You can design a perfectly feasible and secure system with public source and/or algorithms. The SSL protocol, and indeed the very SSL implementation (OpenSSL) used by just about everyone is open-source. Same for ssh. The Advanced Encryption Standard (AES), the topic of FIPS-197, again a U.S. gov't standard encryption algorithm, is also public (it was in fact, selected as part of a public review process).

You can add salt to the system. Wouldn't be that bad of an idea either, except there's no way to do it without having each and every user on the system reset their password in order to do it. And the process and mechanism for doing that is fought with opportunity for chaos and fraud itself.

Adding salt is useless only if everyone uses the same salt value. Whether the implementation is known or not makes no difference. In fact, if any cryptographic system requires the algorithm remain secret, it fails any reasonable test of reliability. That is why "security by obscurity" is never acceptable.

tank wrote:
Just looking for thoughts on this because at some point DragonFly will have to address this issue.

Why does it have to address this? Where is your risk analysis? What is the threat profile? There just is no compelling argument for it.

You need to have the password hashes to begin with, and if someone has free and clear access to you Dragonfly database tables, you've got security problems that have nothing to do with Dragonfly. You can't perform a dictionary attack without the password hash.

_________________
It is pitch black. You are likely to be eaten by a grue.

darkgrue's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu 11.04, Atom D525/Apache 2.2.17/MySQL 5.1.54/PHP 5.3.5/Dragonfly 10.0.04 CVS
Back to top
View user's profile Visit poster's website
xfsunoles
XHTML Specialist
XHTML Specialist

Offline Offline
Joined: Apr 30, 2004
Posts: 2502
Location: Melbourne, Florida
PostPosted: Fri Oct 07, 2005 7:06 pm
Post subject: Re: md5 vs sha1

PGP trying to create stronger SHA-1 but it not going to last forever. In Future, Chinese might break PGP SHA-1 then nothing is secure.


xfsunoles's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS
Back to top
View user's profile Visit poster's website AIM Address MSN Messenger Yahoo Messenger Photo Gallery
tank
Gold Supporter
Gold Supporter

Offline Offline
Joined: Apr 20, 2004
Posts: 824
Location: Houston, Texas USA
PostPosted: Fri Oct 07, 2005 8:44 pm
Post subject: Re: md5 vs sha1

darkgrue wrote:

All cryptographic hashes, now, and in the future, are vulnerable to dictionary attacks. Increasing computing power and the size (and cost) of massive storage decreasing, it's now feasible to precompute large (if not comprehensive) dictionaries. In which case you just find the cyphertext and look up the plaintext, takes no time at all. This is just as true of MD5 as SHA-1. Which is why such algorithms are generally used with a [url=http://en.wikipedia.org/wiki/Salt_(cryptography)]salt[/url] to extend the seach space.

You are not only advocating security by obscurity, which is a FALSE premise to begin with. SHA-1 is a technical revision of SHA (FIPS 180), and it has seen heavy use in the U.S. Federal Government, as well as in commercial applications. It is not obscure or less popular by any means!

You can call it whatever you want but the reality is sites that are popping up in non-hacker community have been increasing at a rate that will eventually spark a bandwagon effect and we'll have more and more people adding resource for the MD5 defeat. I know that all hashes are subseptible to brute force and dictionary attacks. But when the vast majority of the internet public is focusing on MD5 it stand to reason that it needs to be a topic of concern.

darkgrue wrote:

You also glossed over rick_deckard's reply just prior to yours, where he mentions the research team of Xiaoyun Wang, Yiqun Lisa Yin, and Hongbo Yu (mostly from Shandong University in China) have "broken" the SHA-1 algorithm. This is not an esoteric hypothetical attack with a very narrow applicability, it's a serious break in the algorithm. If you believe that MD5 is worthless as a protective measure (it is not) replacing it with one with an acknowledged serious flaw is extremely poor logic, especially if you reason that the popularity of the algorithm is its primary protective value!

I actually did gloss over that. And perhaps that is the reason for holding off changing. It would be an acceptable answer to me. I realize that alternative methods aren't always better. But I at least like to know that it's being given attention.

darkgrue wrote:

/sigh OK, you're way off now... You can design a perfectly feasible and secure system with public source and/or algorithms. The SSL protocol, and indeed the very SSL implementation (OpenSSL) used by just about everyone is open-source. Same for ssh. The Advanced Encryption Standard (AES), the topic of FIPS-197, again a U.S. gov't standard encryption algorithm, is also public (it was in fact, selected as part of a public review process).

This is irrelevant to the topic. I didn't say open source was unsecure. I said publicly viewed code (salt values) is worthless to security becuase anyone can view the salt and also how it is used.

darkgrue wrote:

You can add salt to the system. Wouldn't be that bad of an idea either, except there's no way to do it without having each and every user on the system reset their password in order to do it. And the process and mechanism for doing that is fought with opportunity for chaos and fraud itself.

True

darkgrue wrote:

Adding salt is useless only if everyone uses the same salt value. Whether the implementation is known or not makes no difference. In fact, if any cryptographic system requires the algorithm remain secret, it fails any reasonable test of reliability. That is why "security by obscurity" is never acceptable.

Exactly what I said above

darkgrue wrote:

Why does it have to address this? Where is your risk analysis? What is the threat profile? There just is no compelling argument for it.

You need to have the password hashes to begin with, and if someone has free and clear access to you Dragonfly database tables, you've got security problems that have nothing to do with Dragonfly. You can't perform a dictionary attack without the password hash.

Then why have any hash at all with that thinking? That's just silly. WE ar talking about hashing Passwords not system security. There are a few ways people can get the hash out side of system penetratrion. Cookies left on Public Access computer comes to mind. True.. that is the users stupidity but it can and does happen.

As to my risk analysis. This is not the forum for formalities like that. My risk analysis is just what I posted. DragonFly uses MD5 and no salt or any other method to obscure the hash and I just vistied two popular sites (one that was featured on Slashdot) that specialize in throwing hardware at brute forcing the MD5 hash specifically. I have yet to see a popular site that does that for SHA1. They are out there I'm sure. But MD5 seem to be the Hash in the spotlight and I don't forsee it going away.

_________________
Search is your friend

tank's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora Core 1, Apache 1.3.33, Mysql 4.1.14, PHP 5.0.5 w/ APC cache, Dragonfly 9.0.6.1
Back to top
View user's profile Visit poster's website
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Fri Oct 07, 2005 11:20 pm
Post subject: Re: md5 vs sha1

The MD5 is used serverside so they need to break in first to get the hash.
Since they already broke in, they don't need the hash (after all they are already there)

Passwords are hashed to provide some sort of protection to your members in case someone brakes in. This because humans use one password for everything, so when someone downloads all your members he can login anywhere.

I have also one password but if someone hacks a website i'm member of (like getfirefox.com which was one of the last), he can only spam websites i'm member of because all my important things always have a unique password and none the same.

If everyone used unique passwords on each website we don't need hashing at all.


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
Display posts from previous:   
Post new topic    Revive this topic    Printer Friendly Page    Forum Index ⇒  Security
Page 1 of 2
All times are GMT
Go to page 1, 2  Next

Archive Revive
Username:
This is an archived topic - your reply will not be appended here.
Instead, a new topic will be generated in the active forum.
The new topic will provide a reference link to this archived topic.
 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

Διαβάστε περισσότερα ...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy