algorithm - Ideal hashing method for wide distribution of values? -


as part of rhythm game i'm working, i'm allowing users create , upload custom songs , notecharts. i'm thinking of hashing song , notecharts uniquely identify them. of course, i'd few collisions possible, however, cryptographic strength isn't of importance here wide uniform range. in addition, since i'd performing hashes rarely, computational efficiency isn't big of issue.

is easy selecting tried-and-true hashing algorithm largest digest size? or there intricacies should aware of? i'm looking @ either sha-256 or 512, currently.

all cryptographic-strength algorithm should exhibit no collision @ all. of course, collisions exist (there more possible inputs possible outputs) should impossible, using existing computing technology, find one.

when hash function has output of n bits, possible find collision work 2n/2, in practice hash function less 140 bits of output cannot cryptographically strong. moreover, hash functions have weaknesses allow attackers find collisions faster that; such functions said "broken". prime example md5.

if not in security setting, , fear random collisions (i.e. nobody actively try provoke collision, may happen out of pure bad luck), broken cryptographic hash function fine. usual recommendation md4. cryptographically speaking, broken can be, non-cryptographic purposes devilishly fast, , provides 128 bits of output, avoid random collisions.

however, chances not have performance issue sha-256 or sha-512. on basic pc, process data faster hard disk can provide: if hash file, file reading bottleneck, not hashing. advice use sha-256, possibly truncating output 128 bits (if used in non-security situation), , consider switching function if performance-related trouble duly noticed , measured.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -