Is there an MD5 Fixed Point where md5(x) == x?

Since an MD5 sum is 128 bits long, any fixed point would necessarily also have to be 128 bits long. Assuming that the MD5 sum of any string is uniformly distributed over all possible sums, then the probability that any given 128-bit string is a fixed point is 1/2128. Thus, the probability that no 128-bit … Read more

yii CPasswordHelper: hashPassword and verifyPassword

CPasswordHelper works like PHP’s functions password_hash() and password_verify(), they are wrappers around the crypt() function. When you generate a BCrypt hash, you will get a string of 60 characters, containing the salt. // Hash a new password for storing in the database. $hashToStoreInDb = password_hash($password, PASSWORD_BCRYPT); The variable $hashToStoreInDb will now contain a hash-value like … Read more

Are there any SHA-256 javascript implementations that are generally considered trustworthy? [closed]

OUTDATED: Many modern browsers now have first-class support for crypto operations. See Vitaly Zdanevich’s answer below. The Stanford JS Crypto Library contains an implementation of SHA-256. While crypto in JS isn’t really as well-vetted an endeavor as other implementation platforms, this one is at least partially developed by, and to a certain extent sponsored by, … Read more

Probability of SHA1 collisions

Are the 160 bit hash values generated by SHA-1 large enough to ensure the fingerprint of every block is unique? Assuming random hash values with a uniform distribution, a collection of n different data blocks and a hash function that generates b bits, the probability p that there will be one or more collisions is … Read more