[tahoe-dev] [pycryptopp] #18: AES-CTR: easy way to modify the counter for random-access decryption

pycryptopp trac at allmydata.org
Fri Apr 3 00:49:46 UTC 2009

#18: AES-CTR: easy way to modify the counter for random-access decryption
Reporter:  warner       |           Owner:       
    Type:  enhancement  |          Status:  new  
Priority:  major        |         Version:  0.5.1
Keywords:               |   Launchpad_bug:       
 I'd like to improve Tahoe's download process to allow random-access
 decryption. To do this, I need to be able to tell the AES decryptor object
 to process data from arbitrary points in the keystream.

 I think it's possible to do this with the current API, by creating a new
 AES instance every time the counter jumps, and passing it an {{{iv=}}}
 argument which is a string into which we've packed the current offset. But
 this is too hard, and the {{{iv=}}} argument accepts arbitrary-length
 strings, making it difficult to confirm that we're supposed to pass in a
 string whose length is the same as the AES block size.

 I'd like to have an extra argument to {{{process()}}}, which will reset
 the counter value. This argument should take a positive number (an int or
 long). If this argument is not provided, the counter should use the normal
 self-incrementing value. So:

  a = AES(key)
  data1 = AES.process("abcde")
  data2 = AES.process("fghij")
  data3 = AES.process("klmno")

 should produce the same "data1", "data2", and "data3" as:

  a = AES(key)
  data2 = AES.process("fghij", counter=5)
  data3 = AES.process("klmno")
  data1 = AES.process("abcde", counter=0)

Ticket URL: <http://allmydata.org/trac/pycryptopp/ticket/18>
pycryptopp <http://allmydata.org/trac/pycryptopp>
Python bindings for the Crypto++ library

More information about the tahoe-dev mailing list