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 subtle crate for constant-time comparison #107

Closed
kos-for-juspay opened this issue Dec 11, 2022 · 1 comment · Fixed by #77
Closed

Use subtle crate for constant-time comparison #107

kos-for-juspay opened this issue Dec 11, 2022 · 1 comment · Fixed by #77
Labels
E-easy Effort: Should be easy to implement and would make a good first PR

Comments

@kos-for-juspay
Copy link
Contributor

Usual comparison is not safe in cryptography as is lazy (fail-fast) and makes the code potentially vulnerable to timing attacks: https://www.chosenplaintext.ca/articles/beginners-guide-constant-time-cryptography.html.
Use crates like subtle for constant-time comparison of secret values: https://docs.rs/subtle.

https://github.com/juspay/orca/blob/dff8b22489e36058326bee36b2c91014cdb4c9f2/crates/masking/src/strong_secret.rs#L54-L62

@kos-for-juspay kos-for-juspay added the E-easy Effort: Should be easy to implement and would make a good first PR label Dec 11, 2022
@kos-for-juspay
Copy link
Contributor Author

fixed #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Effort: Should be easy to implement and would make a good first PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant