I am looking for a good crate for RSA encryption and key derivation. Context: backend, Rust.
Had a look at RSA, ring, etc.
I need a library able to derive keys based on a random seed (which can be obtained from the mgmt. canister), because random generators like rand do not work on the IC.
Maybe there is a way to go like:
seed → pseudo random number generator → rsa private key generation → …
there is only one interface to get Vec random bytes in the mgmt.
Personally, I think it can do nothing.
And now I’m writing a random library based on rust that can be compiled on IC.
I’m no longer using it, and people will need to make their own assessment on the security implications of doing so.
I went that route because http-sig depended on ring. I thought about trying to add support for RustCrypto but I didn’t want to do anything that came close to rolling my own cryptography. In the end I think RustCrypto didn’t have an implementation of the necessary signature schemes anyway.
Since I had to introduce client-side code to sign HTTP messages, and there was a lot of overhead/risk on the canister side, I decided to do away with HTTP Message Signatures altogether and use the IC’s native authentication mechanism instead.