gpt4 book ai didi

javascript - Web Crypto API - IndexedDB 中的不可精确 CryptoKey 是否足够安全,不会从一个设备传递到下一个设备?

转载 作者:行者123 更新时间:2023-11-28 14:28:51 25 4
gpt4 key购买 nike

Web Crypto API 提供了将私钥或公钥保存为客户端 IndexedDB 数据库中特殊的、不透明类型的对象的可能性,即客户端和 JS 运行时可以使用 CryptoKey,但无法拼写出来。此外,在生成或导入所述 key 时,可以规定该 key 是不可提取的。

我的目标是在用户的客户端设备上保存个人私钥,并将其用作他的数字签名。对我来说,重要的是要知道在设备之间传递此 CryptoKey 有多难或多容易,我的用户将此 CryptoKey 提供给他的 friend 或将其复制到他的另一台设备有多难。

最佳答案

标记为不可提取的 key 无法导出

WebCrypto 规范绝对清晰。请参阅 exportKey definition 第 6 节

14.3.10. The exportKey method When invoked, the exportKey method MUST perform the following steps:

  1. Let format and key be the format and key parameters passed to the exportKey method, respectively.

  2. Let promise be a new Promise.

  3. Return promise and asynchronously perform the remaining steps.

  4. If the following steps or referenced procedures say to throw an error, reject promise with the returned error and then terminate the algorithm.

  5. If the name member of of the [[algorithm]] internal slot of key does not identify a registered algorithm that supports the export key operation, then throw a NotSupportedError.

  6. If the [[extractable]] internal slot of key is false, then throw an InvalidAccessError.

key Material 必须是隐藏的,即使它存储到 IndexedDB 中,如果 key 不可提取,也无法导出,因此您可以认为该 key 无法在其他设备中复制

关于javascript - Web Crypto API - IndexedDB 中的不可精确 CryptoKey 是否足够安全,不会从一个设备传递到下一个设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52276862/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com