From 7bc876a29d4d5cfebf6874bfb12656975786d995 Mon Sep 17 00:00:00 2001 From: ANISH M <58029804+Anish-M-code@users.noreply.github.com> Date: Mon, 6 Sep 2021 19:45:14 +0530 Subject: [PATCH] Fix TypeError in line 8 TypeError: ord() expected string of length 1, but int found this error occured because contents of str1 was like b'\x13\x14\x19\x0e\x1c\x10\x01\x02J\x08%\x19N\x14]\x0e%\x18I%\x1fN\t\x13\x16\x03%\x18\x08J\x11I\x14\x07' currently fixed issue by replacing str1 with str1.decode() --- 2019/Inctf/Crypto/Single Byte/xor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2019/Inctf/Crypto/Single Byte/xor.py b/2019/Inctf/Crypto/Single Byte/xor.py index 0610c5a..89577f6 100644 --- a/2019/Inctf/Crypto/Single Byte/xor.py +++ b/2019/Inctf/Crypto/Single Byte/xor.py @@ -5,7 +5,7 @@ fl='' -for i in str1: +for i in str1.decode(): fl+=chr(ord(i)^ord('z'))