Пример #1
0
def main(protocol='encrypt or decrypt'):
    if protocol == 'encrypt':
        encrypt.main()
    elif protocol == 'decrypt':
        decrypt.main()
    else:
        title('E R R O R')
        print("There's been a bug... Sorry about that.")
Пример #2
0
def main():
    args = getArgs()
    Vig_key = readFile(args.Vig_key)
    AES_key = readFile(args.AES_key)
    img = get(args.port)
    final_value = decrypt.main(Vig_key, AES_key, 'step_image.png')
    writeFile(final_value)
    print '________'
    print 'End'
Пример #3
0
def main():
    args = getArgs()
    keyVig = readFile(args.keyVig)
    keyAes = readFile(args.keyAes)
    img = get(args.port)
    with open("test.png", 'wb') as f:
        f.write(bytearray(img))
    res = decrypt.main(keyVig, keyAes, 'test.png')
    writeFile(res)
    print('tne end')
Пример #4
0
def main():
    args = getArgs()
    keyVig = readFile(args.keyVig)
    keyAes = readFile(args.keyAes)
    img = get(args.port)
    with open("test.png", 'wb') as f:
        f.write(bytearray(img))
    res = decrypt.main(keyVig, keyAes, 'test.png')
    writeFile(res)
    print('tne end')
Пример #5
0
def main():
    args = getArgs()
    data = reading(args.inFile)
    key = reading(args.key)

    if args.mod == 'c':
        encrypt_ = encrypt.main(data, key)
        writing(args.out, encrypt_)
    else:
        decrypte_ = decrypt.main(data, key)
        writing(args.out, decrypte_)
Пример #6
0
elif month == 4:
    prefix = 'APR'
elif month == 3:
    prefix = 'MAR'
elif month == 2:
    prefix = 'FEB'
elif month == 1:
    prefix = 'JAN'
text = prefix + ' ' + year
del year, month, day, prefix



try:
    import decrypt
    decrypt.main()
    appointment_file = open("appointments.dat",'r+')
    for y in range(len(days)):
        for x in range(7):
            x = appointments[y][x]
except:
    fo = open("appointments.dat", "w")
    file_before = ""
    for x in range(37):
        file_before += "\n"
    fo.write(file_before)
    fo.close()
    del fo, file_before
    appointment_file = open("appointments.dat",'r+')
    print("Handled Exception")
appointments = appointment_file.read().split('\n')
Пример #7
0
def test_main():
    main('music')
    main()
    main('none')
Пример #8
0
def funDec():
    directory = decrypt.main()
    messagebox.showinfo(message="El mensaje fue descifrado en: " + directory,
                        title="Título")
def menu():
    print("---------------------- Menu --------------------------")
    print("1 - Generate a key public and private")
    print("2 - Encrypt a file")
    print("3 - Decrypt a file")
    print("4 - Exit")


while True:
    menu()

    opcionMenu = raw_input("Choose an option: >> ").strip()

    if opcionMenu == "1":
        GenerateKeys.main()

    elif opcionMenu == "2":
        encrypt.main()

    elif opcionMenu == "3":
        decrypt.main()

    elif opcionMenu == "4":
        break
    else:
        print("")
        raw_input(
            "You have not pressed any correct option...\npress a key to continue "
        )