def aes128_decrypt(self, msg):
iv = os.urandom(16)
aes_obj = AES.new(self.key, AES.MODE_CBC, iv)
decrypted_msg = aes_obj.decrypt(msg)
return decrypted_msg
を解読しようとするたびに、私は解読するためにこれを使用していますし、MSGはByteArrayのようで渡されている私は。 AES128暗号化のためのPython 3とpycryptodomeライブラリを使用しています、私は見ていますエラーは次のとおりです。。Python用Pycryptodomeライブラリを使用して、私はTypeError例外を取得しています:文字列はCコードに渡すことができるバイトのみ」私は
msg = bytearray(b'M\xb1\xbfw\xf4o\x15\xff\xda{u\xba)\xcd\x9fu\x80\xb2\x0c*s\x17%6\xfeA\xb84\xab\x89\xff\x16A\xb8')
def expect_byte_string(data):
if not byte_string(data) and not isinstance(data, Array):
raise TypeError("Only byte strings can be passed to C code")
TypeError: Only byte strings can be passed to C code