#1 2024-08-23 23:22:22

anouri
Member
Registered: 2024-02-11
Posts: 43

How can I implement OAEP padding in RSA

Hi,
Can't find in documentation. I need:
OaepPadding
OaepHash = sha256

Offline

#2 2024-08-24 06:39:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: How can I implement OAEP padding in RSA

Only RSASSA-PKCS1-v1_5 and RSASSA-PSS are supported yet.
RSASSA-PKCS1-v1_5 is what OpenSSL uses for its open/seal functions.

Offline

#3 2024-08-24 07:00:09

anouri
Member
Registered: 2024-02-11
Posts: 43

Re: How can I implement OAEP padding in RSA

So, I can't use X509 for this?

Offline

#4 2024-08-24 07:10:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: How can I implement OAEP padding in RSA

mormot.crypt.rsa.pas does not support OAEP yet.

What is your use case?

Offline

#5 2024-08-24 07:22:29

anouri
Member
Registered: 2024-02-11
Posts: 43

Re: How can I implement OAEP padding in RSA

It is requierment of taxpayer system.
Taxpayer document says:
After encryption of the bill, through the AES/GCM algorithm, the encrypted symmetric key and IV must be placed next to the encrypted bill. To encrypt the symmetric key, the asymmetric RSA-OAEP-SHA256 method must be used, which is obtained from the public key(s) of the taxpayer system with a length of 4096 bits. A valid intermediate center is used (the public key of the taxpayer system is obtained using the GET_SERVER_INFORMATION method).
C# example of this document is :
https://jsfiddle.net/8w2u3sex/

Last edited by anouri (2024-08-24 08:23:00)

Offline

#6 2024-08-25 07:08:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: How can I implement OAEP padding in RSA

Taxes are good if well spend.
When I see the specs, I can tell you it is not the case here. Using 4096-bit and OAEP is just a joke.

I will see how to add OAEP padding.

Offline

#7 2024-09-24 08:38:46

anouri
Member
Registered: 2024-02-11
Posts: 43

Re: How can I implement OAEP padding in RSA

Is there a future plan to implement OAEP ?

Offline

#8 2024-09-24 10:02:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: How can I implement OAEP padding in RSA

Not yet.

Any pull request is welcome.

Offline

Board footer

Powered by FluxBB