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
의 암호를 해독하려고 할 때마다 나는 . 파이썬 3 및 AES128 암호화를 위해 pycryptodome 라이브러리를 사용하고 내가보고하고 오류는 다음과 같습니다.가 나는 형식 오류를 얻고있다 :. 만 바이트 문자열을 C 코드로 전달 될 수있다 "나는이 해독하고 MSG가 된 ByteArray로 전달되고 사용하고
이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