Question: I'm trying to decrypt a session key in c++ using openssl EVP library. Both the session key and a public key are on a separate

I'm trying to decrypt a session key in c++ using openssl EVP library. Both the session key and a public key are on a separate files. To decrypt the session key I need to encrypt it with the public key. I'm trying to use this:

int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen);

However, I can't seem to get it to work. Could someone give me an example of how to use it when you're given the filenames of where both the public and session keys are?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!