Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
padding xxtea key bits
Browse files Browse the repository at this point in the history
  • Loading branch information
Mas0nShi committed Apr 2, 2021
1 parent aed0a14 commit 33b2bc3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def decrypt(filePath, key):
:param key: xxteaKey
:return: None
"""
if len(key) < 16:
key += "".join("\0" * (16 - len(key))) # key填充
data = read_jsc_file(path=filePath)
dec_data = xxtea.decrypt(data=data, key=key, padding=False)
if dec_data[:2] == b"PK":
Expand Down Expand Up @@ -195,4 +197,4 @@ def main():


if __name__ == "__main__":
main()
main()

0 comments on commit 33b2bc3

Please sign in to comment.