#266 new enhancement

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

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

to build the offloaded-uploaded (#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 (0)

Note: See TracTickets for help on using tickets.