Beispiel #1
0
def correction(pwd, feature):
    coordinates = table.extract(pwd, feature)
    for i in xrange(len(feature)):
        tmp = coordinates[i]  # save the original coordinate
        coordinates[i] = table.extract_at(pwd, feature, i)  # extract the other entry from table
        h_pwd_ = poly.get_h_pwd(coordinates)
        if history.decrypt(h_pwd_):
            return True
        coordinates[i] = tmp  # restore the original coordinate
    return False
Beispiel #2
0
def main():
    initialize()
    while reader.has_next():  # if there is still login attempts to process
        pwd, feature = reader.next_login()
        h_pwd_ = poly.get_h_pwd(table.extract(pwd, feature))  # use the coordinates extracted from table to get h_pwd
        if history.decrypt(h_pwd_):
            print 1
            update(pwd, feature)
        else:
            if correction(pwd, feature):
                print 1
                update(pwd, feature)
            else:
                print 0