0

I am trying to make a simple GUI with some basic options of GPG in order to make it easier for new people to use this tool. I need to place a terminal in my GUI, so that trough the GUI the user can click buttons which activate commands in the terminal. With this program people could get used to see the commands working and I avoid the problem of the introduction of the passwords. I want this program to be free software, so that if anyone who helps wants to complete it and share it, please feel free to doing so (well, I would like to see it working correctly firstxD)

I have searched this things but the only answer which looked useful for me does not work (when I click the button of send it simlpy does nothing). I leave here the link to the this other question and my code:

Link: Giving a command in a embedded terminal

My code:

from tkinter import *
import tkinter.ttk as ttk
import os

def cifrado():
    archivo=filebox.get()
    algoritmo=algo_selec.get()
    orden='gpg -ca --cipher-algo '+str(algoritmo)+' '+str(archivo)
    os.system(orden) #I need to run this on the terminal

window=Tk()
window.title('GPG Gui')
window.geometry("600x600")

notebook=ttk.Notebook(window)
notebook.pack(fill='both', expand='yes')
frame1 = ttk.Frame(notebook)
frame2 = ttk.Frame(notebook)
notebook.add(frame1, text='Cifrados simétricos')
notebook.add(frame2, text='Cifrados asimétricos')

#Symmetric encryption part    
filelabel=Label(frame1,text='Archivo: ')
filelabel.grid(row=1,column=1)
filebox=Entry(frame1)
filebox.grid(row=1,column=2)

algolabel=Label(frame1,text='Algoritmo: ')
algolabel.grid(row=2,column=1)
algo_selec=ttk.Combobox(frame1,values=["IDEA","3DES","CAST5","BLOWFISH","AES","AES192","AES256","TWOFISH","CAMELLIA128","CAMELLIA192","CAMELLIA256"]) #DESPLEGABLE
algo_selec.set("AES256")
algo_selec.configure(width=18)
algo_selec.grid(row=2,column=2)

keylabel=Label(frame1,text='Contraseña: ')
keylabel.grid(row=3,column=1)
keybox=Entry(frame1,show="*",width=20)
keybox.grid(row=3,column=2)

b1=Button(frame1,text="Cifrar",command=lambda:cifrado())
b1.grid(row=1,column=3)
#Well, I need to write here the code of the terminal and connect it to the 'cifrado()' function

#Asymmetric encryption

window.mainloop()
criptos
  • 1
  • 1

0 Answers0