From 52fd4bad6d785ee9542ee857aa04f68a9f4f57a4 Mon Sep 17 00:00:00 2001 From: Oliver Heimlich Date: Tue, 29 Dec 2020 10:23:49 +0100 Subject: [PATCH] Fix character encoding during decryption --- tplink_smartplug.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tplink_smartplug.py b/tplink_smartplug.py index e40a0ca..909de69 100755 --- a/tplink_smartplug.py +++ b/tplink_smartplug.py @@ -78,12 +78,12 @@ def encrypt(string): def decrypt(string): key = 171 - result = "" + result = [] for i in string: a = key ^ i key = i - result += chr(a) - return result + result.append(a) + return bytearray(result).decode('utf-8') # Parse commandline arguments