def hack_vigenere(ciphertext):
    all_likely_key_lengths = kasiski_examination(ciphertext)
    if (not SILENT_MODE):
        key_length_str = ''
        for keyLength in all_likely_key_lengths:
            key_length_str += f'{keyLength} '
        print((('\nKasiski Examination results say the most likely key lengths are: ' + key_length_str) + '\n'))
    hacked_message = None
    for keyLength in all_likely_key_lengths:
        if (not SILENT_MODE):
            print(('Attempting decrypt with key length %s (%s possible keys)...' % (keyLength, (NUM_MOST_FREQ_LETTERS ** keyLength))))
        hacked_message = attempt_hack_with_key_length(ciphertext, keyLength)
        if (hacked_message is not None):
            break
    if (hacked_message is None):
        if (not SILENT_MODE):
            print('Unable to hack message with likely key length(s). Brute forcing key length...')
        for keyLength in range(1, (MAX_KEY_LENGTH + 1)):
            if (keyLength not in all_likely_key_lengths):
                if (not SILENT_MODE):
                    print(f'Attempting decrypt with key length {keyLength} ({(NUM_MOST_FREQ_LETTERS ** keyLength)} possible keys)...')
                hacked_message = attempt_hack_with_key_length(ciphertext, keyLength)
                if (hacked_message is not None):
                    break
    return hacked_message
def hack_vigenere(ciphertext):
    all_likely_key_lengths = kasiski_examination(ciphertext)
    if (not SILENT_MODE):
        key_length_str = 
        for keyLength in all_likely_key_lengths:
            key_length_str += f'{keyLength} '
        print((('\nKasiski Examination results say the most likely key lengths are: ' + key_length_str) + '\n'))
    hacked_message = None
    for keyLength in all_likely_key_lengths:
        if (not SILENT_MODE):
            print(('Attempting decrypt with key length %s (%s possible keys)...' % (keyLength, (NUM_MOST_FREQ_LETTERS ** keyLength))))
        hacked_message = attempt_hack_with_key_length(ciphertext, keyLength)
        if (hacked_message is not None):
            break
    if (hacked_message is None):
        if (not SILENT_MODE):
            print('Unable to hack message with likely key length(s). Brute forcing key length...')
        for keyLength in range(1, (MAX_KEY_LENGTH + 1)):
            if (keyLength not in all_likely_key_lengths):
                if (not SILENT_MODE):
                    print(f'Attempting decrypt with key length {keyLength} ({(NUM_MOST_FREQ_LETTERS ** keyLength)} possible keys)...')
                hacked_message = attempt_hack_with_key_length(ciphertext, keyLength)
                if (hacked_message is not None):
                    break
    return hacked_message