c - How to encrypt data using RSA, with SHA-256 as hash function and MGF1 as mask generating function? -


i doing experiments cryptography. have public key of receiver , want encrypt data , pass receiver.

i want use rsaes-oaep algorithm. sha-256 hash function , mgf1 mask generation function.

i want using openssl. found function rsa_public_encrypt() function can specify padding. 1 of padding option available

rsa_pkcs1_oaep_padding
eme-oaep defined in pkcs #1 v2.0 sha-1 , mgf1 .

they using sha-1.

i want reconfigure function use sha256 hash function ans mgf1 hash function. how can ?

openssl uses definitions pkcs #1 v2.0 , default eme-oaep sha-1 , mgf1. if need use sha-256, you'll need encoding yourself. isn't terribly difficult however, see pkcs #1 v2.2 pdf page 18 details.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -