def test_encipher_shift(): assert encipher_shift("ABC", 0) == "ABC" assert encipher_shift("ABC", 1) == "BCD" assert encipher_shift("ABC", -1) == "ZAB"
def test_encipher_shift(): assert encipher_shift("ABC", 0) == "ABC" assert encipher_shift("ABC", 1) == "BCD" assert encipher_shift("ABC", -1) == "ZAB" assert decipher_shift("ZAB", -1) == "ABC"
def caesar(msg, key, **kwargs): et = encipher_shift(msg, key, symbols=symbols) dt = decipher_shift(et, key, symbols=symbols) return et, dt
def encriptarCesar(frase): frase = encipher_shift(frase, -1) return frase
sutil(GG + "¿Que quieres hacer?" + WW) print(" ") corrida(CC + "1)Encriptar archivo" + WW) print(" ") corrida(CC + "2)Encriptar palabra" + WW) print(" ") corrida(CC + "3)Desencriptar palabra" + WW) print(" ") variable = int(input(GG + "Elige una opcion: " + WW)) print(" ") if variable == 1: archivo = open("archivo.txt", "r") cifrado = encipher_shift(archivo.txt, 13) archivo = open("archivo.txt", "w") archivo.write(cifrado) elif variable == 2: c1 = medio(CC + "Ponga la frase y el tipo de root con el que desea encriptar" + GG) os.system("sleep 1") c2 = str(input("frase >>>>> ")) os.system("sleep 1") c3 = int(input("root >>>>> ")) print(CC + "Vale, en breve se le dara su frase encriptada")