Changeset 3
- Timestamp:
- 10/17/12 18:09:53 (12 years ago)
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
bletchley-distutils
r1 r3 6 6 sys.dont_write_bytecode = False 7 7 8 setup(name='bletchley', version=BLETCHLEY_VERSION, package_dir={'':'lib'}, packages=['bletchley' ])8 setup(name='bletchley', version=BLETCHLEY_VERSION, package_dir={'':'lib'}, packages=['bletchley', 'bletchley.PaddingOracle']) -
lib/bletchley/PaddingOracle/CBCREncryptionOracle.py
r1 r3 38 38 def encrypt_block(self,input_block, prev_block = None): 39 39 if (len(input_block) != self.blockSize): 40 print "Received input block of len ",len(input_block)40 print("Received input block of len ",len(input_block)) 41 41 raise InvalidBlockError(self.blockSize,len(input_block)) 42 42 -
lib/bletchley/PaddingOracle/TimingWebPaddingOracle.py
r1 r3 38 38 39 39 if(encoder== None and decoder!=None) or (encoder!=None and decoder==None): 40 print "ERROR: Encoder and decoder must be both set or not set at all. Disabling both."40 print("ERROR: Encoder and decoder must be both set or not set at all. Disabling both.") 41 41 self.encoder = None 42 42 self.decoder = None … … 82 82 def test_oracle(self): 83 83 if(self.oracle_name == None or self.oracle_value == None): 84 print "ERROR: Cannot test_oracle if no oracle variable defined"84 print("ERROR: Cannot test_oracle if no oracle variable defined") 85 85 return 86 86 … … 116 116 #FIXME most likely this will find a difference 117 117 if(time1 != time2): 118 print "Found difference for i="+hex(b)119 print "Original timing: " + str(time1)120 print "Bad timing: " + str(time2)118 print("Found difference for i="+hex(b)) 119 print("Original timing: " + str(time1)) 120 print("Bad timing: " + str(time2)) 121 121 self.time_threshold = abs(time1 - time2) / 2 + min(time1,time2) 122 122 if(time1 > time2): … … 125 125 self.oracle_type = 0x02 #Normal timing is lower than threshold 126 126 return True 127 print "ERROR: Could not find a difference."127 print("ERROR: Could not find a difference.") 128 128 return False 129 129 130 130 def oracle(self,ctext): 131 131 if(self.time_threshold == None): 132 print "ERROR: Oracle not defined!"132 print("ERROR: Oracle not defined!") 133 133 else: 134 134
Note: See TracChangeset
for help on using the changeset viewer.