Skip to content

Commit

Permalink
fix(login/encryption): fix the pycryptodome error
Browse files Browse the repository at this point in the history
  • Loading branch information
wklken committed Mar 22, 2024
1 parent 257d8c3 commit f2e320c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paas2/login/common/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def encrypt(plaintext, key="", base64=True):
key = force_bytes(key)
key = hashlib.md5(key).digest()
cipher = AES.new(key, AES.MODE_ECB)
ciphertext = cipher.encrypt(pad(plaintext))
pad_text = pad(plaintext)
ciphertext = cipher.encrypt(pad_text.encode("utf-8"))

# 将密文base64加密
if base64:
Expand Down

0 comments on commit f2e320c

Please sign in to comment.