Changeset 52


Ignore:
Timestamp:
07/09/13 11:17:19 (11 years ago)
Author:
tmorgan
Message:

fixed an off-by-one

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/TODO

    r21 r52  
    1212Future
    1313======
     14
     15* Generalize CBC-R methods to support any block decryption oracle
     16  http://blog.spiderlabs.com/2013/06/cbc-r-its-not-just-for-padding-oracles.html
    1417
    1518* Codetective
  • trunk/lib/bletchley/CBC/__init__.py

    r48 r52  
    33
    44Copyright (C) 2010 ELOI SANFÈLIX
    5 Copyright (C) 2012 Timothy D. Morgan
     5Copyright (C) 2012-2013 Timothy D. Morgan
    66@author: Eloi Sanfelix < eloi AT limited-entropy.com >
    77@author: Timothy D. Morgan < tmorgan {a} vsecurity . com >
     
    223223        suffix = struct.pack("B"*len(suffix),*suffix)+block
    224224
    225 
     225        # XXX: catch any signal exceptions, such as ^C, and communicate
     226        #      this back to the rest of the script so it can end immediately
    226227        for x in range(0, 1+self.retries):
    227228            # Each thread spawned searches a subset of the next byte's
     
    284285            if pad_bytes == None:
    285286                # XXX: custom exception
     287                self.log_message("Could not determine pad length")
    286288                raise Exception
    287289           
     
    314316               
    315317        # Finally decrypt first block
    316         decrypted = self.decrypt_block(self._iv, blocks[0], partial) + decrypted
     318        if finished_blocks < len(blocks):
     319            decrypted = self.decrypt_block(self._iv, blocks[0], partial) + decrypted
    317320       
    318321        # Remove the padding and return
Note: See TracChangeset for help on using the changeset viewer.