[DHA]: A new hashing algorithm

The fear of every surveillance society: citizens protecting their own privacy with strong cryptography

[DHA]: A new hashing algorithm

Post by payload on Tue Jan 01, 2013 5:08 pm
([msg=71942]see [DHA]: A new hashing algorithm[/msg])

Hello there fellows,
a few weeks ago I came up with my own hashing algorithm and I could use some feedback. It was made in 2 hours in Python.
It is available on GitHub.

There is a good explanation of how it works. If anyone can look at it and analyze it, it would be good.
Report all collisions and suggest corrections. Thanks. :P
payload
New User
New User
 
Posts: 2
Joined: Tue Jan 01, 2013 3:10 pm
Blog: View Blog (0)


Re: [DHA]: A new hashing algorithm

Post by fashizzlepop on Tue Jan 01, 2013 9:23 pm
([msg=71947]see Re: [DHA]: A new hashing algorithm[/msg])

I'd suggest making this importable.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2303
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: [DHA]: A new hashing algorithm

Post by WallShadow on Wed Jan 02, 2013 11:54 am
([msg=71953]see Re: [DHA]: A new hashing algorithm[/msg])

payload wrote:Hello there fellows,
a few weeks ago I came up with my own hashing algorithm and I could use some feedback. It was made in 2 hours in Python.
It is available on GitHub.

There is a good explanation of how it works. If anyone can look at it and analyze it, it would be good.
Report all collisions and suggest corrections. Thanks. :P


Do you have psuedocode of it or just written in a different language? Python is one of the few that I can't utilize, sorry.
User avatar
WallShadow
Contributor
Contributor
 
Posts: 612
Joined: Tue Mar 06, 2012 9:37 pm
Blog: View Blog (0)


Re: [DHA]: A new hashing algorithm

Post by fashizzlepop on Wed Jan 02, 2013 4:14 pm
([msg=71961]see Re: [DHA]: A new hashing algorithm[/msg])

I ran a quick test on it by testing combinations of 3 characters ascii 32 to 126.
Code: Select all
import itertools

** DHA function here **

def main():
  print "[+] Running collision tester"
  print "[+] Testing strings of length 1-3"

  chars = ""

  for i in range(32,126):
    chars += chr(i)

  print "[+] Testing strings with the following characters:\n" + chars

  onechar = list(itertools.product(chars, repeat=1))
  print "\n[+] Number of strings to test of length:\n\t1 char: " + str(len(onechar))
  twochar = list(itertools.product(chars, repeat=2))
  print "\t2 chars: " + str(len(twochar))
  thrchar = list(itertools.product(chars, repeat=3))
  print "\t3 chars: " + str(len(thrchar))

  hashes = {}

  total = onechar
  total += twochar
  total += thrchar

  collisions = 0

  for s in total:
    #print "[+] testing '" + ''.join(s) + "'"
    h = dha(''.join(s))
    if not h in hashes:
      hashes[h] = ''.join(s)
    else:
      collisions += 1
      print "[-] " + ''.join(s) + ":" + h + " matches " + hashes[h] + ":" + h

  print "[-] Total collisions found: " + str(collisions)


It found 283915 collisions in combinations of just 3 characters...

It appears that # and / and , within strings caused many collisions. With just 2 char strings there are still plenty of collisions and it won't take as long to run as it does with 3 if you want to see the collisions for yourself. Just wrap your script up in a function call dha()
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2303
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: [DHA]: A new hashing algorithm

Post by payload on Thu Jan 03, 2013 8:26 am
([msg=72001]see Re: [DHA]: A new hashing algorithm[/msg])

Thanks. Looks like it is not secure at all. I better come up with DHA2. :P
payload
New User
New User
 
Posts: 2
Joined: Tue Jan 01, 2013 3:10 pm
Blog: View Blog (0)



Return to Crypto

Who is online

Users browsing this forum: No registered users and 0 guests

cron