Skip to content

Commit

Permalink
Use of UTF-8 in messages
Browse files Browse the repository at this point in the history
  • Loading branch information
biblioeteca committed Jun 23, 2021
1 parent 8a2d9de commit afacb79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nomorepass/mcrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def encrypt(password, plaintext, chunkit=True, msgdgst='md5'):
return None

# PKCS#7 padding
padding_len = 16 - (len(plaintext) % 16)
padding_len = 16 - (len(plaintext.encode('utf-8')) % 16)
if isinstance(plaintext, str):
padded_plaintext = plaintext + (chr(padding_len) * padding_len)
else: # assume bytes
Expand Down

0 comments on commit afacb79

Please sign in to comment.