Changeset 71
- Timestamp:
- 08/26/14 18:37:44 (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/bletchley-http2py
r70 r71 124 124 125 125 # from bletchley import blobtools,buffertools 126 # from bletchley import chosenct 126 127 # from bletchley.CBC import * 127 128 … … 222 223 223 224 224 def fetch(data ):225 def fetch(data, other=None): 225 226 ret_val = False 226 227 connection = newConnection() … … 250 251 # Byte-by-byte probing of ciphertext 251 252 # ciphertext = blobtools.decode('{ encoding }', data) 252 # result = chosenct.probe_bytes(fetch, data, [1,2,4,8,16,32,64,128], max_threads=5)253 # result = chosenct.probe_bytes(fetch, ciphertext, [1,2,4,8,16,32,64,128], max_threads=5) 253 254 # print(result.toHTML()) 254 255 ''') -
trunk/lib/bletchley/chosenct.py
r65 r71 75 75 76 76 def _generate_colors(self, s): 77 if isinstance(s, str): 78 s = s.encode('utf-8') 77 79 base=bytes(hashlib.md5(s).digest()[0:6]) 78 80 color1 = "#%.2X%.2X%.2X" % tuple(base[:3]) … … 96 98 message = self._raw_table[offset][v] 97 99 bg,fg = self._generate_colors(message) 98 message = message.decode('utf-8') 100 if not isinstance(message, str): 101 message = message.decode('utf-8') 99 102 100 103 truncated = message[0:maxlen]
Note: See TracChangeset
for help on using the changeset viewer.