60bit hashing algorithm

925 views Asked by At

Is there a cryptographically secure hashing algorithm which gives a message digest of 60 bits?

I have a unique string (id + timestamp), I need to generate a 60 bit hash from it. What will be the best algorithm to create such a hash?

3

There are 3 answers

1
President James K. Polk On BEST ANSWER

You can always take a hash algorithm with a larger output size, e.g. sha256, and truncate it to 60 bits. Whether that is appropriate for your needs I cannot say without much more information. 60 bits is generally considered way too short for most security needs.

0
SoWhat On

There is no 60 bit algorithm for encryption. Algorithms are in powers of 2. I suggest using sha1 to create the hash. It is 128 bit

hash=sha1(id + timestamp)

If you must(not recommended) compress this, use substring to reduce it to 64 bits

smallHash=substr(hash, 0,8) 

(8 characters=64 bits)

0
Peter O. On

Any hashing algorithm that has a 60-bit output size can at maximum provide only 30 bits of collision resistance (by the birthday paradox). 30 bits is much too short to be useful in security nowadays.