def recvfrom(self, size, flags=0):
        'Receive datagram and decrypt off socket.'
        string, address = self.__socket.recvfrom(size * 4, flags)
        string = self.__tails.get(address, '') + string
        tail_len = len(string) % 4
        if tail_len:
            self.__tails[address] = string[-tail_len:]
            string = _decode(string[:-tail_len], self.__dm1, self.__dm2)
            return string, address
        else:
            if address in self.__tails:
                del self.__tails[address]
            string = _decode(string, self.__dm1, self.__dm2)
            return string, address
Receive datagram and decrypt off socket.
recipes/Python/572159_SPICE/recipe-572159.py