NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#this code for ENcrypt and Decrypt any plain text you entered using Ceaser Cipher
def Encrypt(pText): #encrypt function
cText = ""
for i in range(len(pText)):
ch = pText[i]
#now we will go for odd
if (i % 2 != 0):
cText += chr((ord(ch) - 1 - 97) % 26 + 97)
#now we will go for even
else:
cText += chr((ord(ch) + 5 - 97) % 26 + 97)
return cText


def Decrypt(cText): #decrypt function
pText = ""
for i in range(len(cText)):
ch = cText[i]
#now we will go for odd
if (i % 2 != 0 ):
pText += chr((ord(ch) + 1 - 97) % 26 + 97)
#now we will go for even
else:
pText += chr((ord(ch) - 5 - 97) % 26 + 97)
return pText

"""
End of Encrypt/Decrypt functions
"""

#here we will start while loop to keep taking from user until he/she enter q
while(1) {
UserChoose = input("Enter your choose e --> Encrypt, d --> Decrypt, q --> quit : ")
#here want to encrypt
if (UserChoose == "e"):
{
UserText = input("Please choose your PlainText you want to encrypt: ")
print("Cipher Text is : ",Encrypt(UserText))
print("Your Plain Text was : ",Decrypt(Encrypt(UserInputText))) }

else:
#here want to decrypt
if (UserChoose == "d"):
{
UserEText = input("Please choose your encrypted text you want to decrypt: ")
print("Plain Text is : ",Decrypt(UserEText))
print("Your Cipher Text was : ",Encrypt(Decrypt(UserEText))) }
else:
#here he/she want to exit
if(UserChoose == "q")
{print("Thank you for using our Tool! See you")
break )

} #end of while
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.