Commit 82c6c3c2 by BellCodeEditor

save project

parent 209f058e
Showing with 13 additions and 4 deletions
...@@ -3,7 +3,8 @@ import random ...@@ -3,7 +3,8 @@ import random
# 私钥 # 私钥
key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!" key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句 # 要加密语句
message = "诺依,周末一起去看动漫展吧!" message = ""
message = input("请输入要加密的语句:")
gan='yetyfgcvtyuawrttetwauettlikiuhjmu' gan='yetyfgcvtyuawrttetwauettlikiuhjmu'
a="" a=""
# 请使用私钥key,对message进行加密 # 请使用私钥key,对message进行加密
...@@ -14,6 +15,14 @@ for i in message: ...@@ -14,6 +15,14 @@ for i in message:
text=i+str1+str2 text=i+str1+str2
a+=text a+=text
a2 = list(a) a2 = list(a)
a2.insert(5,gan) u = random.randint(0,len(a))
a2.insert(u,gan)
b2="".join(a2) b2="".join(a2)
print(b2) print(b2)
\ No newline at end of file
a2.remove(gan)
str7="".join(a2)
i = 0
while(i<len(str7)):
print(str7[i],end="")
i += 3
\ 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