orion-rs / orion

Usable, easy and safe pure-Rust crypto
MIT License
545 stars 30 forks source link

Constant-time Base64-encoding for Argon2i password hash #188

Closed brycx closed 3 years ago

brycx commented 3 years ago

The current encoding and decoding of a PasswordHash in orion::pwhash is not constant-time (also noted in the security section of the docs). It's been in the backlog to implement this, but it seems a viable crate has been released in the meantime: https://github.com/jedisct1/rust-ct-codecs

According to the README, the crate re-implements the encoding formats from libsodium/libhydrogen. It also defines#![forbid(unsafe_code)].

TODO:

vlmutolo commented 3 years ago

Very cool! Glad to see that even the encoding is constant-time now. Will this be added to the automated timing tests?

brycx commented 3 years ago

Will this be added to the automated timing tests?

Good point! Yeah, this could be added to the dudect tests. They also need to be updated regardless, because the GH Actions workflow has stopped because of git-commit-inactivity in that repo. I think those should be running weekly. Adding it to the todos.

brycx commented 3 years ago

Fixed in #189 and constant-time execution tests included in https://github.com/brycx/orion-dudect/pull/6 (still pointing to master branch for Orion, but local tests pass)