dennieku

dennieku

  • NA
  • 33
  • 0

RSA encryption using private key

Apr 20 2011 3:25 PM
Hi,

I want to implement a dutch payment system (iDeal Professional - Rabobank) in my ASP.NET 4.0 website. For communication I have to send an XML message with an encrypted string in it.
First I had to create a private key, using the following command (OpenSSL):
   
openssl genrsa -des3 –out <privatekeyfile> -passout pass:<yourpassword> 1024
Second I had to create a certificate using the following comand (this certificate has already been sent to the payment provider):
   
openssl req -x509 -new -key <privatekeyfile> -passin pass: <yourpassword> -days 3650 -out <certificatefile>

The information, I have received from the payment provider, for encrypting the string is:
1.
Create an SHA1 digest message based on a specific string (http://www.itl.nist.gov/fipspubs/fip180-1.htm)
2.
Encrypt the digest using the private key and RSA (http://www.rsasecurity.com/rsalabs/node.asp?id=2146 /  http://www.rsasecurity.com/rsalabs/node.asp?id=2124)
3.
Base64 encode the encrypted message

Step 1 and 3 are no problem, bu does anybody know how to perform step 2?

Thanks in advance for your answer,
Dennieku


Answers (7)