Exemplo n.º 1
0
def test29():
    message = b'comment1=cooking%20MCs;userdata=foo;comment2=%20like%20a%20pound%20of%20bacon'
    print('message ' ,message)
    tag = dumbHashAuth(hash_secret, message)
    print('hash(secret||message) ',tag)
    newtag = appendMessage(message, tag, b';admin=true');
    print("new tag = ", rawToHex(newtag))
Exemplo n.º 2
0
def test29():
    #这个message就相当于original data
    message = b'comment1=cooking%20MCs;userdata=foo;comment2=%20like%20a%20pound%20of%20bacon'
    #原始tag
    tag = dumbHashAuth(hash_secret, message)
    #新的tag运算,前面已经说过,最后的extra参数对应恶意加入的信息
    newtag = appendMessage(message, tag, b';admin=true')
    print("new tag = ", newtag)
    print("Problem 29 success")
Exemplo n.º 3
0
def checkDumbHashAuth(message, tag):
    return (dumbHashAuth(hash_secret, message) == tag)
Exemplo n.º 4
0
def test29():
    message = b'comment1=cooking%20MCs;userdata=foo;comment2=%20like%20a%20pound%20of%20bacon'
    tag = dumbHashAuth(hash_secret, message)
    newtag = appendMessage(message, tag, b';admin=true');
    print("new tag = ", rawToHex(newtag))
    print("Problem 29 success")