From afacb7969f6e07d77cb91d2fe64a8f4c6f34a775 Mon Sep 17 00:00:00 2001 From: espinosa Date: Wed, 23 Jun 2021 23:53:21 +0200 Subject: [PATCH] Use of UTF-8 in messages --- nomorepass/mcrypt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nomorepass/mcrypt.py b/nomorepass/mcrypt.py index 40b7519..12c55f6 100644 --- a/nomorepass/mcrypt.py +++ b/nomorepass/mcrypt.py @@ -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