code: def write(self, data):
          
          self._check_not_closed()
          if not data:
              return 0
          enc_data = self.encryptor.update(data)
          self.next_fp.write(enc_data)
          self.offset += len(data)
          return len(data)
docs: Encrypt and write the given bytes