def findGoodKeys(cipher):
    for i in range(256):
        mg, plain = tryKey(cipher, rawToHexLUT[i]);
        #print(str(i) + ": " + str(mg));
        if (mg > .050):
            print("potential key: 0x" + rawToHexLUT[i]);
            print("Potential hex(plain): " + str(plain).lstrip("b'").rstrip("'"));
            print("potential plaintext: " + str(hexToRaw(str(plain).lstrip("b'").rstrip("'"))).lstrip("b'").rstrip("'"));
dataset/ETHPy150Open reschly/cryptopals/prob3.py/findGoodKeys/original