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

Make default max scrypt work configurable #38

Closed
str4d opened this issue Dec 31, 2019 · 0 comments · Fixed by #51
Closed

Make default max scrypt work configurable #38

str4d opened this issue Dec 31, 2019 · 0 comments · Fixed by #51

Comments

@str4d
Copy link
Owner

str4d commented Dec 31, 2019

Currently, rage estimates the target work required for around 1 second of effort on the current machine, and then allows a work factor up to 24 higher, or around 16 seconds of effort. This is reasonable for interoperability within rage users, but is a problem for interoperability with the reference Golang implementation:

  • The SHA-256 implementation in the sha2 crate is pure-Rust, and much slower than the assembly-optimized one available in Golang.
  • age picks a work factor of 18 as the default, which is indeed about 1 second of effort on my laptop. But rage picks a work factor of 12 for the same effort, and thus its default max work factor is 16.
  • The UX effect is that age can decrypt rage-encrypted messages, but rage rejects age-encrypted messages with "Excessive work parameter for passphrase".

To address this, the default max work factor should be configurable. We should provide error-message feedback to the user when the work exceeds the currently-configured max work factor, letting them know what the max would need to be to decrypt the message, and we can use the work estimator to inform them how long it would likely take.

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

Successfully merging a pull request may close this issue.

1 participant