

import os
import sys
import time

from . import transposition_cipher as trans_cipher







def       snake_case__    (       ):





     """simple docstring"""







     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()




import os
import sys
import time

from . import transposition_cipher as trans_cipher







def       snake_case__    (       ):





     """simple docstring"""







     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()

