''' Created on Jun 9, 2015 @author: mewolot ''' import Single_Byte as sb from _ast import Num file = open("key_hex_enc","r") Hex = [line.strip("\n") for line in file] file.close() best = 0 BestList = [] for item in Hex: try: List, num = sb.bestScoring(item) except: continue if num > best: best = num BestList = List elif num == best: BestList = BestList + List else: pass print BestList print best
''' Created on Jun 9, 2015 @author: mewolot ''' import Single_Byte as sb from _ast import Num file = open("SingleByteXOR","r") Hex = [line.strip("\n") for line in file] file.close() best = 0 BestList = [] for item in Hex: try: List, num = sb.bestScoring(item) except: continue if num > best: best = num BestList = List elif num == best: BestList = BestList + List else: pass print BestList print best
singleByteBlocks = [] for i in range(0, keySize): Block = [] for b in splitBlocks: Block.append(b[i:i + 2]) singleByteBlocks.append(Block) print singleByteBlocks Cracked = [] for b in singleByteBlocks: str = "" for item in b: str += item list = sb.bestScoring(str) # print list betterList = [] for item in list[0]: if "\\" not in item: betterList.append(item) for line in betterList: print line print Cracked.append(betterList) print reconstructed = []
singleByteBlocks = [] for i in range(0,keySize): Block = [] for b in splitBlocks: Block.append(b[i:i + 2]) singleByteBlocks.append(Block) print singleByteBlocks Cracked = [] for b in singleByteBlocks: str = "" for item in b: str += item list = sb.bestScoring(str) # print list betterList = [] for item in list[0]: if "\\" not in item: betterList.append(item) for line in betterList: print line print Cracked.append(betterList) print reconstructed = []