Commit 9a625bda by BellCodeEditor

auto save

parent 027d3568
Showing with 26 additions and 2 deletions
message = "诺依,周末一起去看动漫展吧!"
message = input("请输入要加密的语句:")
#for i in message:
# length = len(message) #获取列表长度
# i = 0 #i作为索引值,默认从0开始
# while i < length:
# a = message[i]
# print(a)
# i += 1
key = "SDFGHJKL看了你的拉发哦i事件发酵哦怕萨跑哦是否"
#加密后的语句
key_message = ""
noise = "@#$%^&*()_(*&*(&$"
# 请对message进行遍历,取出所有元素
import random #导入随机模块
for i in message:
str1 = i #空执行语句
str2 = random.choice(key)
str3 = random.choice(key)
key_message += (str1 + str2 + str3)
list_m = list(key_message)
index = random.randint(0,len(list_m))
list_m.insert(index,noise)
list_m = "".join(list_m)
print(list_m)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment