|
@ -13,7 +13,7 @@ class InterfaceServeur(Interface): |
|
|
# à compléter |
|
|
# à compléter |
|
|
self.waitForHelloButton = tk.Button(self, text="Serveur Hello", command=self.hello) |
|
|
self.waitForHelloButton = tk.Button(self, text="Serveur Hello", command=self.hello) |
|
|
self.waitForHelloButton.pack() |
|
|
self.waitForHelloButton.pack() |
|
|
self.finishedButton = tk.Button(self, text="Finished", command=self.finish) |
|
|
self.finishedButton = tk.Button(self, text="Finished", command=self.finish, state="disabled") |
|
|
self.finishedButton.pack() |
|
|
self.finishedButton.pack() |
|
|
|
|
|
|
|
|
def hello(self): |
|
|
def hello(self): |
|
@ -23,6 +23,8 @@ class InterfaceServeur(Interface): |
|
|
if self.message.get() == "HELLO": |
|
|
if self.message.get() == "HELLO": |
|
|
self.entree.set(str(self.e)+";"+str(self.n)) |
|
|
self.entree.set(str(self.e)+";"+str(self.n)) |
|
|
self.send() |
|
|
self.send() |
|
|
|
|
|
self.waitForHelloButton['state'] = 'disabled' |
|
|
|
|
|
self.finishedButton['state'] = 'enabled' |
|
|
else: |
|
|
else: |
|
|
print("HELLO n'a pas été reçu.") |
|
|
print("HELLO n'a pas été reçu.") |
|
|
|
|
|
|
|
@ -35,6 +37,9 @@ class InterfaceServeur(Interface): |
|
|
self.set_cleSymetrique(cleSym_dechiffree) |
|
|
self.set_cleSymetrique(cleSym_dechiffree) |
|
|
self.entree.set("Finished") |
|
|
self.entree.set("Finished") |
|
|
self.send() |
|
|
self.send() |
|
|
|
|
|
self.finishedButton['state'] = "disabled" |
|
|
|
|
|
self.sendButton['state'] = "enabled" |
|
|
|
|
|
self.recvButton['state'] = "enabled" |
|
|
|
|
|
|
|
|
def dechiffre_RSA(self, msg): |
|
|
def dechiffre_RSA(self, msg): |
|
|
"""déchiffre un message avec sa clé privée""" |
|
|
"""déchiffre un message avec sa clé privée""" |
|
|