Skip to content

Commit 5f3878c

Browse files
Merge pull request #13 from Mastercard/feature/removing-unprintable-chars
Removing un-printable characters from decrypted payload
2 parents d9f438f + 892ee62 commit 5f3878c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

client_encryption/jwe_encryption.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def decrypt_payload(payload, config, _params=None):
9393
aes.update(aad)
9494

9595
decrypted = aes.decrypt(cipher_text)
96-
decoded_payload = decrypted.decode().rstrip('\x03').strip()
96+
decoded_payload = ''.join(c for c in decrypted.decode() if c.isprintable())
9797

9898
if isinstance(json.loads(decoded_payload), list):
9999
json_payload = json.loads(decoded_payload)

0 commit comments

Comments
 (0)