Python错误CryptProtectData密钥在指定的s中无效

2024-04-26 19:11:17 发布

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

我有脚本用Python脚本导出chrome密码使用win32api函数CryptProtectData但是解密密码不起作用下面是代码和错误 错误

Traceback (most recent call last):
  File "E:\www\scripts_py\chromepass\aa.py", line 23, in <module>
    pwd = win32crypt.CryptUnprotectData(pwd, None, None, None, 0) #This returns a tuple description and the password
pywintypes.error: (-2146893813, 'CryptProtectData', 'Key not valid for use in specified state.')

代码

^{pr2}$

Tags: 函数代码inpy脚本none密码most
1条回答
网友
1楼 · 发布于 2024-04-26 19:11:17

每台计算机都有自己的本地加密密钥,因此,只有加密数据的计算机才能解密它。 我假设在您的例子中,您试图从不同的计算机读取登录数据,您的windows计算机没有解密密码所需的密钥,因此您得到了上述错误。 我建议在源计算机上解密数据,并通过开放的套接字/电子邮件将结果传递到目的地。在

相关问题 更多 >