Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secp256k1 may not be suitable for EDCH encryption: they are susceptible to Twist Attacks #105

Open
theblockstalk opened this issue May 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@theblockstalk
Copy link
Contributor

secp256k1 keys may not be suitable for EDCH

I found out about this issue when looking into using a secp256k1 key using the well supported did-jwt library, where I found this note: https://github.com/decentralized-identity/veramo/blob/0c22cc6a79e974214500e4440b0ea2977012377d/packages/utils/src/did-utils.ts#L269

I then followed up and found secp256k1 keys are not supported due to Twist attacks. See here

This issue is prevalent during the EDCH code found in https://github.com/wharfkit/antelope/blob/master/src/crypto/shared-secret.ts

@theblockstalk theblockstalk added the bug Something isn't working label May 14, 2024
@jnordberg
Copy link
Collaborator

If I don't misremember eos public keys are always compressed so would be hard for an attacker to craft a malicious public key. Wouldn't hurt to validate the point in the shared secret method though, if the elliptic library doesn't do it already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants