-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement PKE #30
Comments
I would prefer to keep this repo focused on Kyber alone, certainly though it should be in the examples as a template for correct usage. Have raised the point of creating a hybrid KEM api in #12, which on reflection should be a in separate crate, that perhaps is also a good place for including built-in encryption/decryption functions that use pluggable RustCrypto cipher traits. Big fan of easy-to-use crypto, but separation of concerns takes precedence here. |
Hey, @tbraun96! It looks like you were able to implement this functionality independently? I stumbled upon it when looking for a way to handle CRYSTALS-Kyber encryption in Rust, and it seems your library is the most complete (it was honestly the only one I could find). I'm not the best at cryptography (hence why I'm not implementing the encryption myself...), so I was wondering if you feel your implementation is cryptographically sound. I will follow the recommendation to use Kyber in a "hybrid mode" of course, but I'm wondering if your implementation is fine or if I should just wait for a more established implementation to be developed. edit: since Kyber establishes a shared symmetric secret, couldn't some flavour of AES be used for the actual encryption in a real-world scenario? |
It's not: it uses the inner "indcpa" PKE which has malleable ciphertexts. Don't use it. Instead, use HPKE with full IND-CCA2 Kyber. |
Thanks! |
Hello, I'm writing on behalf of the @RustCrypto project. We maintain the It would be interesting for this crate to implement those traits. See
There's also this existing implementation of HPKE it should be possible to plug Kyber into: https://github.com/rozbb/rust-hpke cc @rozbb |
rust-hpke has support for Kyber (in a branch), see rozbb/rust-hpke#43 |
Hey Tony, certainly keen to add those KEM traits (#10) but was trying to avoid a Would be happy with the traits behind a feature gate though. |
@mberry our next release will get rid of Feature gating the functionality seems like a good way to avoid the extraneous dependencies. |
HPKE is big scope and OOB for this project. You can find a proposal on how to do this here: https://datatracker.ietf.org/doc/draft-westerbaan-cfrg-hpke-xyber768d00/ Closed for housekeeping reasons. Always happy to discuss it further though. |
Performing key-exchange with Kyber is only half the story. Using the resulting keys to perform encryption/decryption of chosen plaintexts should also be a feature of this crate.
The text was updated successfully, but these errors were encountered: