1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| import pyotp import tkinter as tk
def SecretKeyGet(): secret_key = labelEntry.get() return secret_key
def ValGet(secret_key): totp = pyotp.TOTP(secret_key) val = totp.now() return val
def HitBotton (): global on_hit if on_hit == False: on_hit = True var.set(ValGet(SecretKeyGet())) else: on_hit = False var.set('再点一次||Click once again')
def CreatWindow(): window = tk.Tk() window.title("Github2FA_Solver(SelfUseGUI-1.0.0)") window.geometry("450x500") labelMainText = tk.Label(window, text="Github2FA_Solver", bg="white", fg="black", font=("Arial", 35), width=35, height=2, relief="flat") labelTipEntry = tk.Label(window, text="输入你的密钥字符串||Enter your secret key", bg="white", fg="black", font=("Arial", 15), width=45, height=2, relief="ridge") global labelEntry labelEntry = tk.Entry(window,bd=4,font=("Arial", 15), width=50, relief="ridge") labelTipOutput = tk.Label(window, text='输出||Output', bg="white", fg="black", font=("Arial", 15), width=45, height=2, relief="ridge") global labelOutput global var var = tk.StringVar() labelOutput = tk.Entry(window,textvariable=var,bd=4, font=("Arial", 15), width=50, relief="ridge",state=tk.NORMAL,exportselection=1) global on_hit on_hit = False labelButton = tk.Button(window,text='解密||Decrypt',height=2,command=HitBotton) labelTailText1 = tk.Label(window, text="采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 CS青椒!", bg="white", fg="black", font=("Arial", 12), width=50, height=2, relief="flat") labelTailText2 = tk.Label(window, text="有效期30s||Use in 30s", bg="white", fg="black", font=("Arial", 12), width=50, height=2, relief="flat") labelMainText.pack() labelTipEntry.pack() labelEntry.pack() labelTipOutput.pack() labelOutput.pack() labelButton.pack() labelTailText2.pack() labelTailText1.pack() window.mainloop() def main(): CreatWindow() main()
|