Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-5_DIY1
This project
Loading...
Sign in
Toggle navigation
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
Commit
56ea6f06
authored
Jan 25, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
fd2f8465
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
加密.py
加密.py
View file @
56ea6f06
impor
t
random
impor
t
random
import
random
message
=
"如果十点不来就不等你了"
c
=
input
(
"请输入你要加密的文字"
)
明文
=
c
干扰
=
"唐三是史莱克七怪里"
秘钥
=
"代表VS大不搜都不服"
秘钥
=
"唐三是史莱克七怪里最厉害的"
w
=
random
.
choice
(
秘钥
)
mingwenlist
=
list
(
明文
)
a
=
random
.
randint
(
0
,
len
(
明文
))
mingwenlist
.
insert
(
a
,
干扰
)
print
(
mingwenlist
)
for
str1
in
message
:
str2
=
random
.
choice
(
"秘钥"
)
+
random
.
choice
(
"秘钥"
)
print
(
str1
+
str2
,
end
=
""
)
for
i
in
message
:
print
(
i
)
c
=
"奥斯卡"
w
=
list
(
c
)
a
=
""
join
(
w
)
print
=
(
a
)
带干扰的明文
=
""
.
join
(
mingwenlist
)
print
(
带干扰的明文
)
for
i
in
带干扰的明文
:
str1
=
random
.
choice
(
秘钥
)
+
random
.
choice
(
秘钥
)
print
(
i
+
str1
,
end
=
""
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment