![]() ![]() Print(privatekey.exportKey()) #export under the 'PEM' format (I think)įile.write(privatekey.exportKey()) #save exported private keyĮnc_data = publickey.encrypt(data, 16) #encrypt message with public keyĬonnexion = socket.socket(socket.AF_INET, socket.SOCK_STREAM)Ĭnd(str(enc_data)) # send encrypted data, this appears to be the source of the problemĭec_data = crypt(enc_data) # test decryptionĬlientconnexion, connexioninfo = connexion.accept()Įnc_data = clientconnexion.recv(1024) # receive encrypted data Keysend also decrypts the encrypted data to verify the result. ![]() Keyreceive imports the private key from the same file, and uses it to decrypt the encrypted data.Keysend encrypts a piece of data and sends it to Keyreceive over the network.Keysend starts up and generates an RSA key, saving the exported private key to a file.Keyreceive starts up and waits to receive the encrypted data.To break down the problem, I have created 2 programs : Keyreceive and Keysend. I am hoping to keep the encrypted data format as well as the format of the keys as simple as possible in order to allow compatibility with other languages. I am trying to get 2 programs to share encrypted data over a network using public keys, but I am stuck with a difficult problem : the information that is shared (the keys and/or the encrypted data) seems to get modified. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |