Also, what does the output of this python program give you ?
Code:
# This simple program does a sha1 hash of a string of chars
# alternating between chr(85) and chr(170)
import sha
# amount of memory to gobble during test.
memory2waste = 100000000 # almost 100 megs.
# precalculate hashes
firsthash = sha.new( memory2waste * chr(85) ).hexdigest()
secondhash = sha.new( memory2waste * chr(170) ).hexdigest()
print "sha1 hash of", memory2waste,
print "chr(85)'s is: ", firsthash
print "sha1 hash of", memory2waste,
print "chr(170)'s is:", secondhash
print "Now at re-verification stage..."
maxloops = 20
failures = 0
for x in range(maxloops):
if( x % 2 == 0 ):
# use chr(85)
used = 85
somedata = memory2waste * chr(85)
hash = sha.new(somedata).hexdigest()
if( hash == firsthash ):
print "sha1 hash check of chr(85): PASSED!"
else:
print "sha1 hash check of chr(85): FAILED! (x =", str(x) + ")"
failures = failures + 1
else:
used = 170
# use chr(170)
somedata = memory2waste * chr(170)
hash = sha.new(somedata).hexdigest()
if( hash == secondhash ):
print "sha1 hash check of chr(170): PASSED!"
else:
print "sha1 hash check of chr(170): FAILED! (x =", str(x) + ")"
failures = failures + 1
if( failures == 0 ):
print str(maxloops), "hash verifications PASSED!"
else:
print "There were", str(failures), "hash check failures!"