RSA-OAEP using SHA256 with key size 2048

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

RSA-OAEP using SHA256 with key size 2048

This post has NOT been accepted by the mailing list yet.

I was doing some experiments with cryptography. Now I have the public key of receiver and i want to encrypt some data and pass to the receiver.

I want to use RSAES-OAEP algorithm. with SHA-256 as hash function and MGF1 as mask generation function.

I want do this using openssl. I found a function RSA_public_encrypt() with this function we can specify the padding. One of the padding option available was

    EME-OAEP as defined in PKCS #1 v2.0

While checking the below API

int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
                                    const unsigned char *from, int flen,
                                    const unsigned char *param, int plen,
                                    const EVP_MD *md, const EVP_MD *mgf1md)

I can see that we can select the SHA256 using EVP_MD.

How to pass the EVP_MD structure with SHA256 and how to invoke this API by using RSA_public_encrypt()

Any example will help me a lot