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.")
def main(): args = getArgs() data = readFile(args.inFile) keyVig = readFile(args.keyVig) keyAes = readFile(args.keyAes) res = encrypt.main(data, keyVig, keyAes, args.imageFile) send(res, args.host, args.port) print('tne end')
def main(): args = getArgs() data = readFile(args.inFile_text) Vig_key = readFile(args.Vig_key) AES_key = readFile(args.AES_key) res = encrypt.main(data, Vig_key, AES_key, args.imagefile) print '________' send(res, args.host, args.port)
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_)
else: typetext('font.TTF', 50, days[weekNum][dayNum][8:12], dayNum * 100 + 75, weekNum * 75 + 135, True, black, False) typetext('font.TTF', 50, text, 315, 25, True, black, False) # --- Go ahead and update the screen with what we've drawn. pygame.display.flip() # --- Limit to 60 frames per second clock.tick(100) appointment_file.truncate() print(appointments) appointment_file.close() rm("appointments.dat") fo = open("appointments.dat", "w") for wk in appointments: for day in wk: for app in day: print(app + '\n') fo.write(app + '\n') print('\n') fo.write('\n') print('\n') fo.write('\n') print('\n') print('\n') fo.write('\n') fo.write('\n') fo.close() import encrypt encrypt.main()
def inputs(): cmd = "" while (cmd.lower() != "quit"): cmd = raw_input (">>") if cmd.lower() == "help": print ("Available operators are: +, -, *, /, **, root, bin, mean, mode, median, factorial, quit") elif cmd.lower() == '+': add1 = raw_input("Enter first number ") add2 = raw_input("Enter second number ") print ("The sum of these two numbers is " + str(addition(add1, add2))) elif cmd.lower() == "-": sub1 = raw_input("Enter first number ") sub2 = raw_input("Enter second number ") print ("The difference of these two numbers is " + str(subtraction(sub1, sub2))) elif cmd.lower() == "*": multiply1 = raw_input("Enter first number ") multiply2 = raw_input("Enter second number ") print ("The product of these two numbers is " + str(multiplication(multiply1, multiply2))) elif cmd.lower() == "/": div1 = raw_input("Enter first number ") div2 = raw_input("Enter second number ") print ("The quotient of these two numbers is " + str(division(div1, div2))) elif cmd.lower() == "**": base = raw_input("Enter the base ") exponent = raw_input("Please enter the exponent ") print (str(power(base, exponent))) elif cmd.lower() == "root": root1 = raw_input("Enter a number ") print ("The square root of that number is " + str(root(root1))) elif cmd.lower() == "mean": print data.mean(data.inputs()) elif cmd.lower() == "median": print data.median(data.inputs()) elif cmd.lower() == "mode": print data.mode(data.inputs()) elif cmd.lower() == "deviation": print data.deviation(data.inputs()) elif cmd.lower() == "encrypt": encrypt.main(cmd) elif cmd.lower() == "decrypt": encrypt.main(cmd) elif cmd.lower() == "bin": num1 = raw_input("Enter a number to convert to binary ") print bin_convert(num1) elif cmd.lower() == "factorial": print factorial.factorial(factorial.inputs()) elif cmd.lower() == "quit": pass else: print "input not valid, try again" sys.exit()
def funEnc(): directory = encrypt.main() messagebox.showinfo(message="El mensaje fue cifrado 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 " )