Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
5016df98
Commit
5016df98
authored
Aug 04, 2023
by
xiao-hesheng
Browse files
添加加密类,类函数已经验证加密内容是否正确
parent
dacddc0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/passwordUtils.py
View file @
5016df98
...
...
@@ -34,19 +34,20 @@ class PasswordEncrypt(object):
# print("en_text:", en_text)
# print("base64 de_text2:", en_text.hex())
# print('en_text',en_text)
return
en_text
.
hex
()
def
pad
(
slef
,
text
):
print
(
type
(
text
))
#
print(type(text))
text_length
=
len
(
text
)
amount_to_pad
=
AES
.
block_size
-
(
text_length
%
AES
.
block_size
)
print
(
'amount_to_pad'
,
amount_to_pad
)
print
(
type
(
amount_to_pad
))
#
print('amount_to_pad',amount_to_pad)
#
print(type(amount_to_pad))
if
amount_to_pad
==
0
:
amount_to_pad
=
AES
.
block_size
pad
=
chr
(
amount_to_pad
)
print
(
'pad'
,
pad
)
print
(
text
+
pad
*
amount_to_pad
)
#
print('pad',pad)
#
print(text+pad * amount_to_pad)
return
text
+
pad
*
amount_to_pad
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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