Example #1
0
    def Receive_Message(self, encryptionNeeded, encryptionAlgorithm, key):
        BUFFER_SIZE = 2048
        receivedMessage = self.connection.recv(BUFFER_SIZE)
        if (encryptionNeeded == True):
            from Encryption import Encryption
            receivedMessage = Encryption().Decrypt_Message(
                key, receivedMessage[:512])

        receivedMessage = receivedMessage.decode()
        #print("Received message:", receivedMessage)
        return (receivedMessage)