Re: hash of a string is the same string?



so, it means it is known whether a fixed point exists for md5, sha1
and other algorithms? no research has been done in this field? any
pointers?

On Jan 12, 12:33 pm, Ilmari Karonen <usen...@xxxxxxxxxxxxxx> wrote:
On 2009-01-12, countableinfin...@xxxxxxxxx <countableinfin...@xxxxxxxxx> wrote:

Is it possible that the md5 or sha1 hash of a string is the same
string? i.e. hash of s = s?

For a randomly chosen n-bit hash, the probability that there is no
string that hashes to itself is (1 - 1/2^n)^(2^n), which approaches
1/e =~ 0.367879441171442 for sufficently large n.  In practice, even n
= 10 is enough to get within 99.95% of that value.

I don't think there's any known reason to expect either MD5 or SHA1 to
behave in a manner different from a randomly chosen hash of the same
length in this respect.  So for each of them, the probability of there
being at least one string that hashes to itself, purely by chance, is
about 63.21%.

I'm not aware of any such string being found for either MD5 or SHA1.
Of course, if one was found, the probability for that particular hash
would become 100%.

--
Ilmari Karonen
To reply by e-mail, please replace ".invalid" with ".net" in address.

.



Relevant Pages

  • Re: long index strings
    ... I'm sure breaking a long string into 20 byte segments would work, ... What I was hoping for was a way to compute a mathematical hash such ... as MD5 in Filemaker. ... What are the requirements for writing a plug-in of your own? ...
    (comp.databases.filemaker)
  • Re: "Collision for Hash Functions MD4, MD5, HAVAL-128 and RIPEMD"
    ... this was the Year of Doom for cryptographic hash functions. ... These go into great detail on the SHA-0 and MD5 collisions ... Difficulty in the former is called "collision resistance", ... you probably meant to say was "I can find a *different* string whose ...
    (comp.os.linux.security)
  • Re: Need help with regular expression
    ... Hash: SHA1 ... Lars Enderin schreef: ... I'm using String.matches(regex) to find out if the string matches ...
    (comp.lang.java.help)
  • Re: sql syntax error
    ... Hash: SHA1 ... The red highlight is a VBA error indication, not a SQL syntax error. ... the string probably isn't properly formatted for VBA. ...
    (comp.databases.ms-access)
  • Re: if SHA1 and MD5 are cracked...?
    ... which is that both SHA1 and ... > MD5 succumb to attack fairly soon, ... demanding an immediate recall of applications that use either MD5 or ... Theoretically there are two different types of security provided by hash ...
    (comp.unix.bsd.freebsd.misc)