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

MV-02-005 OpenPGP.js: Not all elliptic curve primitives are constant time (Low) #720

Open
cure53 opened this issue Jun 15, 2018 · 0 comments
Labels
Milestone

Comments

@cure53
Copy link

cure53 commented Jun 15, 2018

It was found that the elliptic curve ciphers offered by OpenPGP.js are exposed by different providers depending on the underlying client platform. Some curves (secp256k1, all brainpool variants, Curve25519 and ED25519) are only exposed via the elliptic.js provider. That provider does not appear to implement constant-time logic for elliptic curve operations.

For Curve25519 and ED25519, this less of a problem since these curves use the Montgomery elliptic curve equations, which are almost always constant time but with some notable exceptions. However, OpenPGP.js will always run scalar multiplication operations on the other curves in non-constant time. This is because Edwards curves and Weierstrass curves require custom logic in order to behave in a constant time fashion.

Affected Code:
https://github.com/openpgpjs/elliptic.git

Since JavaScript makes constant-time execution more difficult to reliably achieve, there exists no sure-fire recommendation for achieving constant time operation on these primitives in the current library. Instead, we recommend simply prioritizing the migration in to lower-level implementations. These can be eventually provided by NodeCrypto (which uses OpenSSL) and WebCrypto.

However, recent research interest in producing constant time primitives in WebAssembly may also lead to easily loadable web libraries that perform all ECC operations in constant time in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants