import string, collections, re

def generate_key(rot):
    return zip(string.ascii_lowercase, string.ascii_uppercase[rot:] + string.ascii_uppercase[:rot])

def decipher(ciphertext, rot):
    key = generate_key(rot)
    for x, y in key:
        ciphertext = ciphertext.replace(x, y)
    return ciphertext

def brute_force(ciphertext):
    for rot in range(1, 26):
        arrow = "<========== LOOK HERE" if rot == 7 else "" # we know the 7th row will contain the correct decrypt
        print("{rot:02d}: ".format(rot=rot), decipher(ciphertext, rot))

if __name__ == "__main__":
    ciphertext = "vwe qa bpm eqvbmz wn wcz lqakwvbmvb uilm otwzqwca acuumz"
    print("Performing a brute force attack\n")
    brute_force(ciphertext)
    print("\nAnswer: This was said by Richard III\n")
