On Tue, Sep 21, 2021 at 9:54 AM Benjamin Schäfer <skullman1...@gmail.com> wrote:
>
> In the end it could be broke down to: I want to encrypt a std::string (the 
> JSON Web Token) with the public key I created out of x and y with crypto++. I 
> will take a look into OpenSSL and what I could do with that, but this project 
> seems to get out of hand.

OK, so based on RFC 7516, they provide an example of public key
encryption using RSA/OAEP. That's what we show on our wiki page.

However, in RFC 7518
(https://datatracker.ietf.org/doc/html/rfc7518#section-4.1), the IETF
lists a boat load of other algorithms. But I don't see a "EC-ES256" or
similar that would indicate public key encryption using P-256.

Typically you don't simply encrypt with an elliptic curve. Typically
encryption using elliptic curves is a hybrid public key encryption
scheme, like ECIES. In ECIES, you encrypt a bulk encryption key for a
block cipher like AES under the public key. But even that is slippery
since you don't really encrypt like with RSA. Rather, you use a key
agreement scheme and the person doing the encryption performs half of
the key exchange using a temporary key and the other party's public
key. The other party with the private key performs the other half of
the key agreement, recovers the bulk encryption key, and then uses a
block cipher like AES to decrypt the actual message.

But getting back to your problem... Do you know which JSON algorithm
you are using?

Jeff

-- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/CAH8yC8nMYsqVpR72nO49qGx4Tqqb9CmW0g9ZkK1iXT8Jg52HKg%40mail.gmail.com.

Reply via email to