예제 #1
0
def snipeDecrypt(signature, cbkey, block, encryption):
    siglen = len(signature)
    if encryption:
        xorcypherdata = block[:16]
        cypherdata = byte_xor(cbkey, xorcypherdata)
        data = decrypt(cypherdata, encryption)
        if data[:siglen] == signature:
            return True
    else:
        sigcandidate = block[:siglen]
        if byte_xor(sigcandidate, cbkey) == signature:
            return True
    return False
예제 #2
0
def testDecrypt(bkey, block):
    count = 0
    for subblock in grouper(16, block):
        dec = byte_xor(bkey, subblock)
        if dec == zeroBytes:
            count += 1
    return count
예제 #3
0
def testSpeedInformedDecrypt(cbkey, block, encryption):
    for subblock in grouper(16, block):
        crypdec = byte_xor(cbkey, subblock)
        if encryption:
            dec = decrypt(crypdec, encryption)
        else:
            dec = crypdec
        if dec == zeroBytes:
            return True
    return False
예제 #4
0
def testSpeedDecrypt(bkey, block):
    for subblock in grouper(16, block):
        dec = byte_xor(bkey, subblock)
        if dec == zeroBytes:
            return True
    return False
예제 #5
0
def xorDecrypt(bkey, block):
    return byte_xor(cycle(bkey), block)