def RuntimeTest(self): data = self.testData.strip().split('\n') for i in range(len(data)): start = time() des = DES() key = '0001001100110100010101110111100110011011101111001101111111110001' des.SetKey(key) des.EncryptKey() des.SetInputText(data[i]) des.SetCipherText(des.Encrypt()) desResult = des.Decrypt() stop = time() self.runtime += ('DES runtime:' + str(stop - start) + "s\n") start = time() rsa = RSA() rsa.KeyGeneration(128) rsaResult = rsa.Decryption( rsa.Encryption(int(data[i]), rsa.keyPublic, rsa.n), rsa.keyPrivate, rsa.n) stop = time() self.runtime += ('RSA runtime:' + str(stop - start) + "s\n\n") return self.runtime
def button_processing(): # print(encrypted_data) # print("public key:", publicKeyEntry.get()) # print("N of public key", n_Value_of_public_entry.get()) # print("private key:", privateKeyEntry.get()) # print("N of private key", n_Value_of_private_entry.get()) dictionary = RSA.Decryption(encrypted_data, int(privateKeyEntry.get()), int(n_Value_of_private_entry.get()), int(publicKeyEntry.get()), int(n_Value_of_public_entry.get())) messageLabel.place(relx=0.01, rely=0.5, relheight=0.1, relwidth=0.2) messageEntry.insert(1.0, 'alter validation: ' + str(dictionary['alter validation']) + '\t' + 'entity validation: ' + str(dictionary['entity validation']) + '\n' + 'message:\n' + dictionary['message']) messageEntry['state'] = 'disabled' messageEntry.place(relx=0.21, rely=0.5, relheight=0.25, relwidth=0.75)