Esempio n. 1
0
def startsearch(tool_parameters):
    """
    Starts the search tool for the given parameters
    """

    cipher_suite = {
        "simon": simon.SimonCipher(),
        "speck": speck.SpeckCipher(),
        "simonlinear": simonlinear.SimonLinearCipher(),
        "keccak": keccak.KeccakCipher(),
        "keccakdiff": keccakdiff.KeccakDiffCipher(),
        "ketje": ketje.KetjeCipher(),
        "siphash": siphash.SipHashCipher(),
        "simonrk": simonrk.SimonRkCipher(),
        "simonkeyrc": simonkeyrc.SimonKeyRcCipher(),
        "chaskeyhalf": chaskeymachalf.ChasKeyMacHalf(),
        "ascon": ascon.AsconCipher(),
        "salsa": salsa.SalsaCipher(),
        "chacha": chacha.ChaChaCipher(),
        "skinny": skinny.SkinnyCipher(),
        "gimli": gimli.GimliCipher(),
        "present": present.PresentCipher(),
        "craft": craft.CraftCipher(),
        "trifle": trifle.TrifleCipher(),
        "triflerk": triflerk.TrifleRK(),
        "bat_diff_pattern": bat_diff_pattern.Cipher(),
        "bat_diff_actsbox": bat_diff_actsbox.Cipher(),
        "bat_linear_actsbox": bat_linear_actsbox.Cipher(),
    }

    cipher = None

    if tool_parameters["cipher"] in cipher_suite:
        cipher = cipher_suite[tool_parameters["cipher"]]
    else:
        print("Cipher not supported!")
        return

    # Handle program flow
    if tool_parameters["mode"] == 0:
        search.findMinWeightCharacteristic(cipher, tool_parameters)
    elif tool_parameters["mode"] == 1:
        search.searchCharacteristics(cipher, tool_parameters)
    elif tool_parameters["mode"] == 2:
        search.findAllCharacteristics(cipher, tool_parameters)
    elif tool_parameters["mode"] == 3:
        search.findBestConstants(cipher, tool_parameters)
    elif tool_parameters["mode"] == 4:
        search.computeProbabilityOfDifferentials(cipher, tool_parameters)

    return
Esempio n. 2
0
def startsearch(tool_parameters):
    """
    Starts the search tool for the given parameters
    """

    cipher_suite = {"simon" : simon.SimonCipher(),
                    "speck" : speck.SpeckCipher(),
                    "simonlinear" : simonlinear.SimonLinearCipher(),
                    "keccak" : keccak.KeccakCipher(),
                    "keccakdiff" : keccakdiff.KeccakDiffCipher(),
                    "ketje" : ketje.KetjeCipher(),
                    "siphash" : siphash.SipHashCipher(),
                    "simonrk" : simonrk.SimonRkCipher(),
                    "simonkeyrc" : simonkeyrc.SimonKeyRcCipher(),
                    "chaskeyhalf" : chaskeymachalf.ChasKeyMacHalf(),
                    "ascon" : ascon.AsconCipher(),
                    "salsa" : salsa.SalsaCipher(),
                    "chacha" : chacha.ChaChaCipher(),
                    "skinny" : skinny.SkinnyCipher(),
                    "gimli" : gimli.GimliCipher(),
                    "present" : present.PresentCipher(),
                    "craft" : craft.CraftCipher()}

    cipher = None

    if tool_parameters["cipher"] in cipher_suite:
        cipher = cipher_suite[tool_parameters["cipher"]]
    else:
        print("Cipher not supported!")
        return

    # Handle program flow
    if tool_parameters["mode"] == 0:
        search.findMinWeightCharacteristic(cipher, tool_parameters)
    elif tool_parameters["mode"] == 1:
        search.searchCharacteristics(cipher, tool_parameters)
    elif tool_parameters["mode"] == 2:
        search.findAllCharacteristics(cipher, tool_parameters)
    elif tool_parameters["mode"] == 3:
        search.findBestConstants(cipher, tool_parameters)
    elif tool_parameters["mode"] == 4:
        search.computeProbabilityOfDifferentials(cipher, tool_parameters)

    return
Esempio n. 3
0
def startsearch(tool_parameters):
    """
    Starts the search tool for the given parameters
    """

    cipher_suite = {
        "craft": craft.CraftCipher(),
        "craftrtk": craftrtk.CraftCipherRTK(),
        "craftrtk1": craftrtk1.CraftCipherRTK1(),
        "craftrtk2": craftrtk2.CraftCipherRTK2(),
        "craftrtk3": craftrtk3.CraftCipherRTK3(),
        "craftlinear": craftlinear.CraftCipherLinear(),
        "ein_even": ein_even.EinEven(),
        "em_even": em_even.EmEven(),
        "eout_even": eout_even.EoutEven(),
        "ein_odd": ein_odd.EinOdd(),
        "em_odd": em_odd.EmOdd(),
        "eout_odd": eout_odd.EoutOdd(),
        "ein_even_6r": ein_even_6r.EinEven6r()
    }

    cipher = None

    if tool_parameters["cipher"] in cipher_suite:
        cipher = cipher_suite[tool_parameters["cipher"]]
    else:
        print("Cipher not supported!")
        return

    # Handle program flow
    if tool_parameters["mode"] == 0:
        search.findMinWeightCharacteristic(cipher, tool_parameters)
    elif tool_parameters["mode"] == 1:
        search.searchCharacteristics(cipher, tool_parameters)
    elif tool_parameters["mode"] == 2:
        search.findAllCharacteristics(cipher, tool_parameters)
    elif tool_parameters["mode"] == 3:
        search.findBestConstants(cipher, tool_parameters)
    elif tool_parameters["mode"] == 4:
        search.computeProbabilityOfDifferentials(cipher, tool_parameters)

    return