usage of sha1() function

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
davidklonski
Forum Contributor
Posts: 128
Joined: Mon Mar 22, 2004 4:55 pm

usage of sha1() function

Post by davidklonski »

Hello

I have a theoretical question regarding how sha1() works.
Is it theoretically possible for sha1() to return the same output for two different input strings?

thanks
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: usage of sha1() function

Post by Roja »

davidklonski wrote:Hello

I have a theoretical question regarding how sha1() works.
Is it theoretically possible for sha1() to return the same output for two different input strings?

thanks
Theoretically, yes, it is possible for there to be a collision.

The odds are 2^(n/2), where n, in the case of SHA1, would be 160 (bits). (It would be 2^n, but there is an issue called the 'birthday paradox', which is important here, which lowers it to 2^(n/2))

Thats over one septillion possibilities. Since the peak of the distributed RSA challenge saw 7 billion keys per second, that means it would take distributed.net roughly 1.9 million days to find it.

I'd say thats pretty solid.
User avatar
llanitedave
Forum Commoner
Posts: 78
Joined: Thu Jan 15, 2004 11:24 am
Location: Las Vegas, NV.

Post by llanitedave »

Hopefully, by the time 1.9 million days have passed, the password will have changed!
:P
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Welcome back <username>!
FYI, You have 1.874.601 days, 21 hours, 14 minutes and 02 seconds left before You need to renew your password...
;)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

bahahah :lol:
Post Reply