import TinySHA
import sys

numHashes = 0

if len(sys.argv) < 2:

    print("You need to give me a number of bits")
    exit(0)

firstHash = TinySHA.getTinySHA1(int(sys.argv[1]))
firstSeed = TinySHA.getCurrentSeed()

while True:

    newHash = TinySHA.getTinySHA1(int(sys.argv[1]))
    numHashes += 1
    if newHash == firstHash:

        #print("found a match!\n")
        #print(firstSeed + ":" + firstHash + "\n")
        #print(TinySHA.getCurrentSeed() + ":" + newHash + "\n")
        print(str(sys.argv[1]) + "\t" + str(numHashes))
        exit(0)
Esempio n. 2
0
import TinySHA
import sys

oldMessages = []
oldHashes = []
numHashes = 0

while True:

    currentHash = TinySHA.getTinySHA1(int(sys.argv[1]))
    numHashes += 1
    #print("testing hash: " + currentHash + "\n")

    if currentHash in oldHashes:

        #print("Found a match!\n")
        oldIndex = oldHashes.index(currentHash)
        #print(oldMessages[oldIndex] + ":" + oldHashes[oldIndex] + "\n")
        #print(TinySHA.getCurrentSeed() + ":" + currentHash + "\n")
        print(str(sys.argv[1]) + "\t" + str(numHashes))
        exit(0)

    else:

        oldHashes.append(currentHash)
        oldMessages.append(TinySHA.getCurrentSeed())