Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import string
- def random_string():
- characters = string.ascii_letters
- random_string = ''.join(random.choices(characters, k=3))
- return random_string
- c =1
- while c == 1:
- choice = input("\nWhat you want to do?(C/D/E):")
- #Coding:
- if choice.upper() == "C":
- s = input("\nEnter your message:")
- MsgList = s.split(' ')
- print("\nYour encrypted message is here:")
- r_string1 = random_string()
- r_string2 = random_string()
- for i in MsgList:
- if len(i) <= 2:
- print(i[-1::-1], end = " ")
- else:
- print(r_string1+ i[1:] + i[0] + r_string2 , end = " ")
- #Decoding
- elif choice.upper() == "D":
- s = input("\nEnter the message you received:")
- MsgRcv = s.split(" ")
- print("\nYour decrypted message is here:")
- for i in MsgRcv:
- if len(i) <= 2:
- print(i[-1::-1], end = " ")
- else:
- print(i[-4], end = "")
- print(i[3:-4], end = " ")
- elif choice.upper() == "E":
- print("\n-Signing off!")
- print("\n- Made for dirty stuff( By Anonymous0069 :) )")
- break
Advertisement
Advertisement