Commit 8419aee5 by BellCodeEditor

save project

parent 7fb2758c
Showing with 22 additions and 3 deletions
import random
a=0
b=0
key="faedrbjgfsdjfjhefwhgsdtfuaydfgubcsfhtujsfduycjh"
message=input("请输入要加密的密文:")
for i in message:
str1=i
str2=random.choice(key)
str3=random.choice(key)
str4=random.choice(key)
t=str1+str2+str3+str4
a=str(a)+t
key2="edhfscbhxcmnsdfnfxmndy8ewyujyrdhiesgideiwdvgvvd"
x=list(a)
x.insert(b,key2)
a="".join(x)
list(message)
b=random.randint(1,len(message))
print(a)
\ No newline at end of file
......@@ -2,7 +2,7 @@ import random
l=0
b=0
# 私钥
key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
key = "abcdefg使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句
message = input("请输入需要加密的内容:")
for i in message:
......@@ -19,5 +19,3 @@ list(message)
b=random.randint(1,len(message))
print(l)
# 请使用私钥key,对message进行加密
\ 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