async def decrypt(self, segment: Segment) -> bool: ''' 解密部分 ''' if self.args.disable_auto_decrypt is True: return segment.dump() if segment.is_encrypt() and segment.is_supported_encryption(): cipher = CommonAES(segment.xkey.key, binascii.a2b_hex(segment.xkey.iv)) return cipher.decrypt(segment) else: return segment.dump()
async def decrypt(self, segment: Segment, stream: Stream) -> bool: ''' 解密部分 ''' if self.args.disable_auto_decrypt is True: logger.debug(f'--disable-auto-decrypt, skip decrypt') return segment.dump() if segment.is_encrypt() and segment.is_supported_encryption(): logger.debug( f'common aes decrypt, key {segment.xkey.key.hex()} iv {segment.xkey.iv}' ) cipher = CommonAES(segment.xkey.key, binascii.a2b_hex(segment.xkey.iv)) return cipher.decrypt(segment) else: return segment.dump()