Commit 0a5d4524 by BellCodeEditor

save project

parent b2731838
Showing with 2 additions and 8 deletions
import random import random
# 私钥
key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!" key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句
message = "诺依,周末一起去看动漫展吧!" message = "诺依,周末一起去看动漫展吧!"
# 请使用私钥key,对message进行加密
key_message = '' key_message = ''
for i in message: for i in message:
a = i a = i
...@@ -12,9 +8,6 @@ for i in message: ...@@ -12,9 +8,6 @@ for i in message:
c = random.choice(key) c = random.choice(key)
d = a + b + c d = a + b + c
key_message = key_message + d key_message = key_message + d
print(key_message)
A = list(key_message) A = list(key_message)
A.insert(2,"@#$^&&())_") A.insert(random.randint(0,len(key_message)),"@#$^&&())_")
print("".join(A)) print("".join(A))
\ 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