예제 #1
0
def main():
  print "Code: " + code
  for i in range(1,255): # All legal ASCII characters
    combined = single_xor(challenge1.hex_to_binary(code), i) 

    decoded.append((score(combined), combined))

  top_sorted = sorted(decoded, key=lambda decoding: decoding[0], reverse = True)

  print "Top result: " + str(top_sorted[0])
  print "Runner up: " + str(top_sorted[1])
  print "Third: " + str(top_sorted[2])
예제 #2
0
def main():
    binary = fixed_xor(challenge1.hex_to_binary(str1), challenge1.hex_to_binary(str2))
    print "Binary: " + binary
    print "Hex: " + challenge1.binary_to_hex(binary)