简体   繁体   English

用于加密的 Webauthn

[英]Webauthn for encryption

We have a project with a PWA where we want to implement client sided encryption.我们有一个带有 PWA 的项目,我们希望在其中实施客户端加密。 We wanted to use Webauthn as a second-factor in combination with passwords.我们想将 Webauthn 用作与密码相结合的第二个因素。 In the background we use a randomly generated key to encrypt/decrypt the database, which is stored symmetrically encrypted with the password on the server.在后台,我们使用随机生成的密钥来加密/解密数据库,该密钥与服务器上的密码对称加密存储。 However I am struggling to find a good way to add encryption to this key with webauthn.但是,我正在努力寻找一种使用 webauthn 向此密钥添加加密的好方法。 My tries so far: Using raw JS samples from https://webauthn.guide , however I cannot find a part which is always the same and could be used for symmetric encryption/decryption, even the public key changes when logging in with the same USB token multiple times (???)到目前为止我的尝试:使用来自https://webauthn.guide的原始 JS 示例,但是我找不到始终相同且可用于对称加密/解密的部分,即使使用相同登录时公钥也会更改USB 令牌多次(???)

Using fido2-lib from npm : I couldn't get the sample to work, since the sample is not well documented and pretty long使用npm 中的 fido2-lib :我无法让示例工作,因为示例没有很好的文档记录并且很长

Using server-sided authentication like spring webauthn , however I do not want the server to know anything about the client.使用像spring webauthn这样的服务器端身份验证,但是我不希望服务器知道有关客户端的任何信息。

Any suggestions how I could implement an encryption with webauthn?有什么建议我可以使用 webauthn 实现加密吗?

We have a project with a PWA where we want to implement client sided encryption.我们有一个 PWA 项目,我们想在其中实现客户端加密。 We wanted to use Webauthn as a second-factor in combination with passwords.我们希望将 Webauthn 用作与密码结合使用的第二个因素。 In the background we use a randomly generated key to encrypt/decrypt the database, which is stored symmetrically encrypted with the password on the server.在后台,我们使用随机生成的密钥来加密/解密数据库,该密钥与服务器上的密码对称加密存储。 However I am struggling to find a good way to add encryption to this key with webauthn.但是,我正在努力寻找一种使用 webauthn 向此密钥添加加密的好方法。 My tries so far: Using raw JS samples from https://webauthn.guide , however I cannot find a part which is always the same and could be used for symmetric encryption/decryption, even the public key changes when logging in with the same USB token multiple times (???)到目前为止我的尝试:使用来自https://webauthn.guide 的原始 JS 示例,但是我找不到始终相同的部分并且可以用于对称加密/解密,即使使用相同的登录时公钥也会发生变化USB 令牌多次 (???)

Using fido2-lib from npm : I couldn't get the sample to work, since the sample is not well documented and pretty long使用npm 中的 fido2-lib :我无法让示例工作,因为该示例没有很好的文档记录而且很长

Using server-sided authentication like spring webauthn , however I do not want the server to know anything about the client.使用服务器端身份验证,如spring webauthn ,但是我不希望服务器了解有关客户端的任何信息。

Any suggestions how I could implement an encryption with webauthn?我有什么建议可以使用 webauthn 实现加密吗?

Years after this question, the hmac-secret extension has arrived.在这个问题之后多年, hmac-secret扩展已经到来。

This extension binds a secret to a Webauthn credential.此扩展将秘密绑定到 Webauthn 凭证。 This secret can be used to decrypt or encrypt data on client side.此密钥可用于在客户端解密或加密数据。

Another approach could be the use of the largeBlob to store a secret generated during the creation ceremony.另一种方法是使用largeBlob来存储创建仪式期间生成的秘密。 Note that the availability of those extensions depends on the authenticator that is used and may fail.请注意,这些扩展的可用性取决于使用的身份验证器,并且可能会失败。

You can learn from the following github repo,it has many Webauthn out of the box examples (see the tech it supports inside)您可以从以下 github repo 中学习,它有许多开箱即用的 Webauthn 示例(请参阅它支持的技术)

Here are some samples I found at github https://github.com/OwnID/samples这是我在 github https://github.com/OwnID/samples找到的一些示例

In addition,I read about FIDO,Webauthn and passkeys at passkeys.com此外,我在 passkeys.com 上阅读了有关 FIDO、Webauthn 和passkeys的信息

Everything about this cool tech is there关于这项很酷的技术的一切都在那里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM