-
Notifications
You must be signed in to change notification settings - Fork 34
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
Secrets Management with Secrecy/Zeroize #15
Comments
secrets are out of scope for |
Zeroizing is handled by the parity secp ought to be replaced by |
Might be of interest to you:
I'll add that AFAICT |
good resources, thanks :) |
Just implementing a overwrite-on-drop method doesn't accomplish very much in rust - the fact that moves are memcpy in the language definition means you can't readily hook copies of the secret key material. If you want protection your secret keys always need to be in a |
With some unsafe code you can guarantee the Box creation doesn't touch a stack, but Box indeed is an only options to guarantee no copies at the moment. May be there is a crate for it, but most likely it needs a type wrapper that is not Clone and not Copy, conditionally compiled for |
Fair enough, though a crate with one maintainer and relatively few outside contributors is probably not a great candidate for use when you need to store things that need cryptographic protection. |
secrets is mostly a thin wrapper around libsodium-sys so while yes, it's a concern, it was also by far the best option I found a few months ago in terms of feature-set + proven track record, security-wise (the underlying libsodium, that is) main factor for me was that it wasn't just about zeroing memory, but also using os-level features (e.g. mlock) to provide stronger guarantees on that memory region. the rust layer just mainly ensured this fits nicely with the borrow checker DISCLAIMER: I'm not exactly an expert on this topic, just did quite a bit of research on it recently |
Secrets such as Private Keys must remain in memory for as little as possible to minimize chances of extraction via side-channels and similar methods. They must also never be logged.
All such types in the repo should implement
Zeroize
, so that they're written with 0's once they're dropped (or manually zeroized), and they should be wrapped withSecret
so that they're not accidentally logged. The internal type can be accessed viaExposeSecret
.The text was updated successfully, but these errors were encountered: