def decryptWrapperData(self): packets = self.bufWrapper.getChunks() content = BitArray() for packet in packets: content.append('0b' + packet.content.bin) bytescontent = content.tobytes() decryptcontent = self.rc4.crypt(bytescontent) return decryptcontent
def toBytes(self): data = BitArray() data.append('0b' + self.session_id.bin) data.append('0b' + self.seq_number.bin) data.append('0b' + self.ack.bin) data.append('0b' + self.data_len.bin) data.append('0b' + self.flags.bin) if self.optional_headers: data.append('0b' + self.sync_type.bin) if any(self.content): data.append('0b' + self.content.bin) return data.tobytes()