Question: algorithm for both, signing/verification and encryption/decryption #371
-
I am writing this question because I am using the documentation https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto as main source for the implementation, and the documentation page points to this repository. Thank you for the comprehensive documentation and examples in the first place. My implementation utilizes the native crypto support and pkijs/asn1js libraries. I try to describe the scenario: The client (running in browser) generates a key pair for signing / verification using
Then, the following happens:
The issue is obvious: the private key cannot be used for decryption which is clear because My actual question is: which algorithm needs to be used to support both, signing/verification and encryption/decryption. Using 'RSA-OAEP' (instead of 'RSASSA-PKCS1-v1_5') is not an option because it cannot be used for signing. Is this possible at all? (asking because I haven't found such examples in the documentation). Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @jepetko - I moved the issue over as a discussion, maybe it's more convenient for getting feedback on your question. You're also welcome to join the Discord server to ask there. |
Beta Was this translation helpful? Give feedback.
-
I believe you're not supposed to use the same key for signing/verification and encryption/decryption: https://security.stackexchange.com/questions/1806/why-should-one-not-use-the-same-asymmetric-key-for-encryption-as-they-do-for-sig . The spec has a helpful table listing the algorithms and possible usages: https://w3c.github.io/webcrypto/#algorithm-overview , and you'll see that none of them allow for both encryption and signing. |
Beta Was this translation helpful? Give feedback.
I believe you're not supposed to use the same key for signing/verification and encryption/decryption: https://security.stackexchange.com/questions/1806/why-should-one-not-use-the-same-asymmetric-key-for-encryption-as-they-do-for-sig .
The spec has a helpful table listing the algorithms and possible usages: https://w3c.github.io/webcrypto/#algorithm-overview , and you'll s…