Commit d953e396 by BellCodeEditor

save project

parent ae431ff2
Showing with 9 additions and 22 deletions
import random
l=""
# 私钥
key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句
message=input("请输入:")
k="@#$%^&*^%#@@!#$%"
for i in message:
str1=i
str2=random.choice(key)
str3=random.choice(key)
str4=str1+str2+str3
l=l+str4
listy=list(l)
index=random.randint(0,len(listy))
listy.insert(index,listy)
listy.insert(5,k)
m="".join(list)
print(m)
# 请使用私钥key,对message进行加密
file1=open('C:\\Users\\huawei\\Desktop\\test.txt','w',encoding='utf-8')
file1.write('小兰:12本\n')
file1.write('小强:10本\n')
file1.write('李明:15本\n')
file1.close()
with open('C:\\Users\\huawei\\Desktop\\test.txt','r',encoding='utf-8') as file1:
for data in file1:
print(data)
\ 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