Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_4
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
64863221
authored
Oct 26, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
05effdb2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
gu.py
k.py
gu.py
0 → 100644
View file @
64863221
message
=
input
(
"你要加密什么秘语?"
)
key
=
"vgshxsyushhxsgjsjk"
#第一个干扰字符
import
random
str5
=
""
#str5用来汇总所有的组合数据
#第一次加密
for
i
in
message
:
str1
=
i
str2
=
random
.
choice
(
key
)
str3
=
random
.
choice
(
key
)
str4
=
str1
+
str2
+
str3
str5
=
str5
+
str4
#print(str5)
#第二次加密
noise
=
"@#¥
%
……&***(()(@@¥##"
#第二次干扰的字符
list1
=
list
(
str5
)
#转化成列表
index
=
random
.
randint
(
0
,
len
(
list1
))
#确定索引值,index:索引值
list1
.
insert
(
index
,
noise
)
#插入第二个干扰字符
str6
=
""
.
join
(
list1
)
#把列表转回字符串
print
(
str6
)
k.py
0 → 100644
View file @
64863221
import
random
a
=
random
.
randint
(
1
,
9
)
print
(
a
)
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