Advertisement
Guest User

Orbitt's Basic Text Encrypter

a guest
May 5th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1. #-------------------------------------------------------------------------------
  2. # --- --- --- --- --- --- --- ORBITS TEXT ENCRYPTER --- --- --- --- --- --- ---
  3. #-------------------------------------------------------------------------------
  4.  
  5. done = False
  6. while not done:
  7.     choice = input("Would you like to encrypt or decrypt? enter e/d = ")
  8.     if choice == "e":
  9.         plain_text = input("Enter the text you'd like encrypted = ")
  10.         print("\n")
  11.         encrypted_text = ""
  12.         for c in plain_text:
  13.             x = ord(c)
  14.             x = x + 1
  15.             c2 = chr(x)
  16.             encrypted_text = encrypted_text + c2
  17.         print(encrypted_text)
  18.         print("\n")
  19.        
  20.     elif choice == "d":
  21.         encrypted_text = input("Enter the text you'd like to decrypt = ")
  22.         plain_text = ""
  23.         for c in encrypted_text:
  24.             x = ord(c)
  25.             x = x - 1
  26.             c2 = chr(x)
  27.             plain_text = plain_text + c2
  28.             print(plain_text)
  29.             print("\n")
  30.         else:
  31.             print("DONE!")
  32.     areyoudone = input("Are you done using the encrypter? y/n = ")
  33.     if areyoudone == "y":
  34.         done = True
  35.         print("Thanks for using Orbitt's Encryption Service have a nice day!")
  36.     elif areyoudone == "n":
  37.         done = False
  38.        
  39.     else:
  40.         done = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement