如何使用RNCryp在python中解密字符串

2024-06-01 19:09:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图将加密字符串从一个设备发送到另一个设备。第一个(使用Swift)使用RNCryptor加密字符串并将其发送(作为字符串)。如何使用RNCryptor在Python中解密这个加密字符串?你知道吗

我试图用RNCryptor提供的正常解密方法解密加密的字符串,但它说字符串是“坏数据”。你知道吗

 cryptor = rncryptor.RNCryptor()
 decrypted_data = cryptor.decrypt(code.data, password)
        # -> ERROR: bad data (code.data is a string)

Tags: 数据方法字符串datacodeerrorpasswordswift