Wie sollte man bei Hash-Funktionen (Hash-Algorithmen) mit Hash-Kollisionen (# collision) umgehen, wie handhabbar/ lösbar?

“gleichzeitig” selbe Antwort bzw. selber Wert, d.h. die zeitliche Komponente verfeinern (“der Erste malt zu erst”) oder einen anderen Faktor hinzufügen (z.B.: ; Koordinaten; Lokalität) ?

(3 votes)
Loading...

Similar Posts

Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Erzesel
1 year ago

Without more detailed information, I can only look and orak my “glass ball”.

What do you want?

When it comes to hashcollisions you simply chose a “shmal” agorithmus

Powershell:

$hasher = [System.Security.Cryptography.HashAlgorithm]::Create('MD5')
$hash = $hasher.ComputeHash([System.Text.Encoding]::UTF8.GetBytes('Text to Hash'))
[System.BitConverter]::ToString($hash) -replace '-', ''

#DA330E87EDAAFAD50738838B833E4A5C

MD5 delivers a 128-bit “width” hash value so that 340282366920938463463374607431768211456 possibilities can be distinguished. This number is enormous for itself. Notwithstanding the quite large number, a collision is possible under certain conditions

At SHA512, a collision would be more unlikely than a black hole under your computer chair

The real probability of a collision is 1 to 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096

For SHA256 .. 512 even extremely short strings are no problem https://stackoverflow.com/a/7624669 Collisions are not known.

$hasher = [System.Security.Cryptography.HashAlgorithm]::Create('SHA512')
$hash = $hasher.ComputeHash([System.Text.Encoding]::UTF8.GetBytes('Text to Hash'))
[System.BitConverter]::ToString($hash) -replace '-', ''

#EB0AAC272BAB7C82CBC46A55AE22E08F500AE524F0BBCE48DB9944C0FB9577D0595EF96648F485ACF8A3EE56781FE7CDC9652FAAE3D8B37062DCF995A94BFBF2

..in view of this, you do not need a craft, but simply a sufficient wide hash.

Gaz by the way is simultaneousness an illusion.

If you want to build a login, it is up to you to collect sufficiently distinguishable data for creating a hash.

You may need to check when registering whether there is a similar user and reject his login name. This is the reason why an email address is usually used. The mailhost has already done this work. there are every email address just once. Combined with the “good” password string and a secure hash SHA256 … SHA512 there can only be a clear assignment!

PS: if you can hate long strings part and parts individually You show every paranoia the midfinge already at two 512s the whispering sureal: CAS number

LUCKY1ONE
1 year ago

Never heard of exception handling?
In addition, collisions with modern algorithms are relatively rare.

In your place, I would also use prefabricated libraries.

verreisterNutzer
1 year ago

That depends on the language.
Unfortunately, you also describe your problem very inaccurately.
But “factors” or conditions that change something, you simply do with a “if/else if” function.

KarlRanseierIII
1 year ago

The question is not to be answered, since it depends on the application and what problems a collision entails.