# mBgaus = mB.gausJordan() # print(mBgaus) # mBdet = mB.matDet() # print("determinant: ", mBdet) # print(mB * mB) # print(mB + mB) # print(mB - mB) # print("EIGEN VECTOR \n\n\n") # lm.EgenVe(a) # taylor.TaylorRekke("sin(x)", 9) fourier.Fourier(x**2, -1*(pi/2), pi/2, 1000, False)
def menu(): print("************MAIN MENU**************") rsa = cipher.RSA(64) while True: choice = input(""" A: Wczytaj plik B: Anonimizuj C: FFT D: RSA ECB E: RSA CBC Q: Quit/Log Out Please enter your choice: """) if choice == "A" or choice == "a": root = Tk() filepath = filedialog.asksaveasfilename( initialdir="D:\Programming\python\PNG", title="Select file", filetypes=(("png files", "*.png"), ("all files", "*.*"))) root.destroy() obraz = image.image(filepath) print(obraz) print(obraz.get_ancillary_data()) print('idat: ' + str(obraz.idat)) print('palette: ' + str(obraz.colour_palette)) elif choice == "B" or choice == "b": anonname = input(""" Podaj nazwe pliku po anonimizacji bez rozszerzenia """) anon = anonymisation.Anonymisation() anon.save(filepath, anonname) elif choice == "C" or choice == "c": f = fourier.Fourier() img, shift, spec = f.show_img_fft(filepath) f.show_img_inverse_fft(img, shift, spec) elif choice == "D" or choice == "d": obraz = image.image(filepath) encrypted_name = input(""" Podaj nazwe pliku po zakodowaniu bez rozszerzenia """) decrypted_name = input(""" Podaj nazwe pliku po odkodowaniu bez rozszerzenia """) idat, rests = obraz.getECBEncryptedIDATandRest(rsa) obraz.saveImageWithIDAT(encrypted_name, idat, rests) encrypted = image.image(str(encrypted_name) + '.png') decryptedIdat = encrypted.getECBDecryptedIDAT(rsa) encrypted.saveImageWithIDAT(decrypted_name, decryptedIdat, None) elif choice == 'E' or choice == 'e': obraz = image.image(filepath) encrypted_name = input(""" Podaj nazwe pliku po zakodowaniu bez rozszerzenia """) decrypted_name = input(""" Podaj nazwe pliku po odkodowaniu bez rozszerzenia """) idat, rests, vector = obraz.getCBCEncryptedIDATandRest(rsa) obraz.saveImageWithIDAT(encrypted_name, idat, rests) encrypted = image.image(str(encrypted_name) + '.png') decryptedIdat = encrypted.getCBCDecryptedIDAT(rsa, vector) encrypted.saveImageWithIDAT(decrypted_name, decryptedIdat, None) elif choice == "Q" or choice == "q": sys.exit() else: print("You must only select either A,B,C,D,E,Q") print("Please try again") menu()
def set_fourier_space(self, param): fspace = fourier.Fourier(param) self.fspace = fspace
def fourier_analise(self): ft_plots = ft.Fourier(self.path) ft_plots.display()