paragonie / halite

High-level cryptography interface powered by libsodium
https://paragonie.com/project/halite
Mozilla Public License 2.0
1.13k stars 87 forks source link

What if you already have a RSA 2048 key and you want to use it instead of generating a new key? #171

Closed Zaydovaah closed 3 years ago

Zaydovaah commented 3 years ago

As the title says, I have a public RSA key and I want to use it to encrypt a password (communicating with an API that requires an encrypted password with a public key they gave me). Tried replacing the generated key with the public key I have but it doesn't work since it expects a Hexadecimal key. Tried to do a PEM to HEX conversion but still not working. Any suggestions plz?

paragonie-security commented 3 years ago

You can't, and this library will never support RSA.

In the most convoluted sense, you could use something like EasyRSA to encrypt an ephemeral symmetric key, and then use the symmetric key with Halite. But that's a higher layer of abstraction than Halite.

Zaydovaah commented 3 years ago

You can't, and this library will never support RSA.

In the most convoluted sense, you could use something like EasyRSA to encrypt an ephemeral symmetric key, and then use the symmetric key with Halite. But that's a higher layer of abstraction than Halite.

Hmm I see, thanks. Will see about your suggestion!