#266 new enhancement

pycryptopp: we need random-access AES encryption — at Version 1

Reported by: warner Owned by: zooko
Priority: minor Milestone: eventually
Component: code-encoding Version: 0.7.0
Keywords: upload-helper pycryptopp performance random-access Cc:
Launchpad Bug:

Description (last modified by warner)

to build the offloaded-uploader (#116), we need the ability to do AES CTR mode at arbitrary places in the input stream. I think a second (optional) argument to aes.AES.process() that accepts a byte offset would do the trick. I'm imagining something like:

   def process(self, data, offset=None):
       if offset is None:
           offset = self._last_offset
       block = aes_encrypt(self._key, number_as_string(offset))
       output = xor(data, block)
       self._last_offset = offset + len(data)
       return output

(with all the appropriate joy of handling block boundaries, of course)

Change History (1)

comment:1 Changed at 2008-01-09T01:14:34Z by warner

  • Description modified (diff)
  • Priority changed from major to minor

hmm, robk astutely points out that we might want to re-encrypt the data on the second pass anyways, to build up the hash trees. So we can build the offloaded uploader without this. Lowering the priority.

Note: See TracTickets for help on using tickets.