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

Use better AES/SHA implementations #3

Open
richvdh opened this issue Apr 3, 2017 · 1 comment
Open

Use better AES/SHA implementations #3

richvdh opened this issue Apr 3, 2017 · 1 comment

Comments

@richvdh
Copy link
Member

richvdh commented Apr 3, 2017

At present, libolm uses Brad Conte's portable implementations [1] of SHA-256 and AES-256. These have the advantage of being plain C and therefore work out-of-the-box under emscripten; however they are not side-channel resistant.

I'm not aware of any portable implementations of AES which are resistant to side-channel attacks - indeed it is very difficult to create a constant-time implementation without access to machine-level detail. The correct fix to this is therefore to use different implementations in different environments - for example, we could link against openssl for a C library, and use webcrypto in the browser.

It's also likely that doing so would bring performance improvements.

The main difficulty is that it significantly changes data flows: for example, webcrypto provides an asynchronous interface, which means that the whole olm interface would need to be altered to be asynchronous, at least under emscripten.

@richvdh richvdh changed the title Use better crypto primitives Use better AES/SHA implementations Apr 3, 2017
@spacekitteh
Copy link

spacekitteh commented Apr 7, 2017

libsodium is a pretty good implementation of various crypto primitives... I think it only does AES-GCM, not AES-CBC however :/

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

No branches or pull requests

2 participants