RE: Problem with RSA encryption on w2k
From: Patrick C. Cole (patcole@online.microsoft.com)
Date: 10/03/02
- Next message: Patrick C. Cole: "Re: Forms Authentication and SSL"
- Previous message: vlad: "Re: Problem with DSA in ASP.NET (source code included)"
- In reply to: Joseph: "Problem with RSA encryption on w2k"
- Next in thread: Patrick C. Cole: "RE: Problem with RSA encryption on w2k"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: patcole@online.microsoft.com (Patrick C. Cole (MS)) Date: Thu, 03 Oct 2002 21:10:50 GMT
Joseph,
Let me research the issue further and I will respond as soon as possible.
Patrick Cole
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
--------------------
| From: "Joseph" <joseph@bluefield.com.hk>
| Subject: Problem with RSA encryption on w2k
| Date: Wed, 2 Oct 2002 13:33:51 +0800
| Lines: 52
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Message-ID: <#0usiUdaCHA.2556@tkmsftngp09>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.security
| NNTP-Posting-Host: 203.85.151.129
| Path: cpmsftngxa09!cpmsftngxa10!tkmsftngp01!tkmsftngp09
| Xref: cpmsftngxa09 microsoft.public.dotnet.framework.aspnet.security:2420
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
|
| Hi,
|
| I tried to perform a direct RSA encryption using OAEP padding as follows:
|
| CspParameters param = new CspParameters();
|
| param.Flags = CspProviderFlags.UseMachineKeyStore;
|
| RSACryptoServiceProvider rsaEncrypt = new RSACryptoServiceProvider(param);
|
| rsaEncrypt.FromXmlString(publicKey);
|
| int dataSize = 0;
|
| bool fOAEP = true;
|
| if (fOAEP)
|
| dataSize = (rsaEncrypt.KeySize / 8) - 41;
|
| else
|
| dataSize = (rsaEncrypt.KeySize / 8) - 11;
|
| byte[] toEncrypt = new byte[dataSize];
|
| toEncrypt = System.Text.Encoding.UTF8.GetBytes("My String comes here");
|
| Byte[] encrypted = rsaEncrypt.Encrypt(toEncrypt, fOAEP);
|
|
| }
|
|
| I got the following error when calling Encrypt():
|
| Direct Encryption and decryption using RSA OAEP padding are not available
on
| this platform. SOURCE: mscorlib STACK TRACE: at
|
System.Security.Cryptography.RSACryptoServiceProvider._EncryptPKWin2KEnh(Int
| Ptr hPubKey, Byte[] rgbKey, Boolean fOAEP) at
| System.Security.Cryptography.RSACryptoServiceProvider.Encrypt(Byte[] rgb,
| Boolean fOAEP)
|
|
| High Encryption Pack is already installed on my W2K server. My machine is
| running W2K Server 5.00.2195 SP2. What else is causing this problem?
| Thanks.
|
| Joseph
|
|
|
|
- Next message: Patrick C. Cole: "Re: Forms Authentication and SSL"
- Previous message: vlad: "Re: Problem with DSA in ASP.NET (source code included)"
- In reply to: Joseph: "Problem with RSA encryption on w2k"
- Next in thread: Patrick C. Cole: "RE: Problem with RSA encryption on w2k"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|