示例#1
0
def step_5():
    x = mpz(int(generate_hash(Client['salt'], P), 16))
    S = powmod((Client['B'] - (k * powmod(g, x, N))),
               Client['a'] + (Client['u'] * x), N)
    K = hash_sha256(str(S))
    Client['K'] = K
    return
示例#2
0
def step_5(_S=-1):
    x = mpz(int(generate_hash(Client['salt'], P), 16))
    if _S == -1:
        S = powmod(Client['B'], Client['a'] + (Client['u'] * x), N)
    else:
        S = _S
    K = hash_sha256(str(S))
    Client['K'] = K
    return
示例#3
0
def step_5(passwd=P, _S=-1):
    x = mpz(int(generate_hash(Client['salt'], passwd), 16))
    if _S == -1:
        S = powmod((Client['B'] - (k * powmod(g, x, N))),
                   Client['a'] + (Client['u'] * x), N)
    else:
        S = _S
    K = hash_sha256(str(S))
    Client['K'] = K
    return
示例#4
0
def solver():
    A, b, B, u, hash = srp("")
    fp = open("passwords.txt", "r")
    passwords = fp.readlines()
    for password in passwords:
        password = password.strip()
        print "[*] Trying Password: '******'" % (password)
        x = mpz(int(generate_hash("", password), 16))
        S = t_mod(powmod(A, b, N) * powmod(B, u * x, N), N)
        K = hash_sha256(str(S))
        h = hmac(K, "", hash_function=hash_sha256)
        if h == hash:
            print "[+] Got it. Password = '******'" % (password)
    return
示例#5
0
def step_6():
    S = powmod(Server['A'] * powmod(Server['v'], Server['u'], N), Server['b'],
               N)
    K = hash_sha256(str(S))
    Server['K'] = K
    return
示例#6
0
def generate_hash(salt, data):
    return hash_sha256(salt + data)