





'''simple docstring'''

import random
import sys

lowercase_         =			"""ABCDEFGHIJKLMNOPQRSTUVWXYZ"""





def lowerCamelCase						(					)						->List[str]:
    _SCREAMING_SNAKE_CASE     =      input("""Enter message: """   )
    _SCREAMING_SNAKE_CASE     =      'LFWOAYUISVKMNXPBDCRJTQEGHZ'
    _SCREAMING_SNAKE_CASE     =      input("""Encrypt/Decrypt [e/d]: """   )

    check_valid_key(SCREAMING_SNAKE_CASE__   )

    if resp.lower().startswith("""e"""   ):
        _SCREAMING_SNAKE_CASE     =      'encrypt'
        _SCREAMING_SNAKE_CASE     =      encrypt_message(SCREAMING_SNAKE_CASE__ ,	SCREAMING_SNAKE_CASE__   )
    elif resp.lower().startswith("""d"""   ):
        _SCREAMING_SNAKE_CASE     =      'decrypt'
        _SCREAMING_SNAKE_CASE     =      decrypt_message(SCREAMING_SNAKE_CASE__ ,	SCREAMING_SNAKE_CASE__   )

    print(F'\n{mode.title()}ion: \n{translated}'   )





def lowerCamelCase						(					__lowerCamelCase			:   str   )						->Any:
    _SCREAMING_SNAKE_CASE     =      list(SCREAMING_SNAKE_CASE__   )
    _SCREAMING_SNAKE_CASE     =      list(SCREAMING_SNAKE_CASE__   )
    key_list.sort()
    letters_list.sort()

    if key_list != letters_list:
        sys.exit("""Error in the key or symbol set."""   )





def lowerCamelCase						(					__lowerCamelCase			:   str ,	__lowerCamelCase			:   str   )						->Tuple:
    return translate_message(SCREAMING_SNAKE_CASE__ ,	SCREAMING_SNAKE_CASE__ ,	"""encrypt"""   )





def lowerCamelCase						(					__lowerCamelCase			:   str ,	__lowerCamelCase			:   str   )						->Tuple:
    return translate_message(SCREAMING_SNAKE_CASE__ ,	SCREAMING_SNAKE_CASE__ ,	"""decrypt"""   )





def lowerCamelCase						(					__lowerCamelCase			:   str ,	__lowerCamelCase			:   str ,	__lowerCamelCase			:   str   )						->List[Any]:
    _SCREAMING_SNAKE_CASE     =      ''
    _SCREAMING_SNAKE_CASE     =      LETTERS
    _SCREAMING_SNAKE_CASE     =      key

    if mode == "decrypt":
        _SCREAMING_SNAKE_CASE     =      chars_b, chars_a

    for symbol in message:
        if symbol.upper() in chars_a:
            _SCREAMING_SNAKE_CASE     =      chars_a.find(symbol.upper()   )
            if symbol.isupper():
                translated += chars_b[sym_index].upper()
            else:
                translated += chars_b[sym_index].lower()
        else:
            translated += symbol

    return translated





def lowerCamelCase						(					)						->Optional[int]:
    _SCREAMING_SNAKE_CASE     =      list(SCREAMING_SNAKE_CASE__   )
    random.shuffle(SCREAMING_SNAKE_CASE__   )
    return "".join(SCREAMING_SNAKE_CASE__   )


if __name__ == "__main__":
      main()










'''simple docstring'''

import os
import sys
import time

from . import transposition_cipher as trans_cipher





def lowerCamelCase						(					)						->None:
    _SCREAMING_SNAKE_CASE     =      """Prehistoric Men.txt"""
    _SCREAMING_SNAKE_CASE     =      """Output.txt"""
    _SCREAMING_SNAKE_CASE     =      int(input("""Enter key: """   )   )
    _SCREAMING_SNAKE_CASE     =      input("""Encrypt/Decrypt [e/d]: """   )

    if not os.path.exists(__lowerCamelCase   ):
        print(F'File {input_file} does not exist. Quitting...'   )
        sys.exit()
    if os.path.exists(__lowerCamelCase   ):
        print(F'Overwrite {output_file}? [y/n]'   )
        _SCREAMING_SNAKE_CASE     =      input("""> """   )
        if not response.lower().startswith("""y"""   ):
            sys.exit()

    _SCREAMING_SNAKE_CASE     =      time.time()
    if mode.lower().startswith("""e"""   ):
        with open(__lowerCamelCase   ) as f:
            _SCREAMING_SNAKE_CASE     =      f.read()
        _SCREAMING_SNAKE_CASE     =      trans_cipher.encrypt_message(__lowerCamelCase ,	__lowerCamelCase   )
    elif mode.lower().startswith("""d"""   ):
        with open(__lowerCamelCase   ) as f:
            _SCREAMING_SNAKE_CASE     =      f.read()
        _SCREAMING_SNAKE_CASE     =      trans_cipher.decrypt_message(__lowerCamelCase ,	__lowerCamelCase   )

    with open(__lowerCamelCase ,	"""w"""   ) as output_obj:
        output_obj.write(__lowerCamelCase   )

    _SCREAMING_SNAKE_CASE     =      round(time.time() - start_time ,	2   )
    print(("""Done (""", total_time, """seconds )""")   )


if __name__ == "__main__":
      main()



