Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / lesson7_6

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • lesson7_6
  • diy4.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · 43f126ed
    BellCodeEditor committed 3 years ago
    43f126ed
diy4.py 406 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import random
q=""
# 私钥
key = "abcdefgh使用编程实现位移替换加密"
# 要加密语句()
message = input("输入")
a="xkrbbbbbbbbbbb"
# 请使用私钥key,对message进行加密
for i in message:
    strs1=i
    strs2=random.choice(key)
    strs3=random.choice(key)
    text=strs1+strs2+strs3
    q=text+q
print(q)
w=list(q)
w.insert(random.randint(0,len(w)),a)
print(w)
r="".join(w)
print(r)