Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / November 2004

Tip: Looking for answers? Try searching our database.

Unknown failure in RSACyptoServiceProvider.Decrypt() on Win98

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott - 22 Nov 2004 06:29 GMT
I am decrypting using RSACyptoServiceProvider with a 1024 bit key and OAEP
padding set to false.  I load the RSA key in from an XML string (originally
from a machine key store container) that is pass to this method.  It works
fine on WinXP, but fails on Win98, with a CryptographicException containing
the following unhelpful message:

    Unknown failure; unable to generate error message.

On Win98 I am running IE v6.0.2800.1106 and I believe it has strong
cryptography built-in.  The Exception is raised in the call to rsa.Decrypt().
The stack trace shows it is actually raised within _DecryptKey(IntPtr hCSP,
IntPtr hPubKey, Byte[] rgbKey, Int32 dwFlags) which is called directly by
rsa.Decrypt().  

FromXmlString() works correctly on both platforms and I have used
ExportParameters() to confirm the keys are identical on both Win98 and WinXP.


Has anyone had this problem before?  I would appreciate your help.

Thanks,
Scott.

Here is the C# function:

private byte[] RSADecrypt(byte[] msg, string xmlKey)
{
 try
 {
   RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
   rsa.FromXmlString(xmlKey);
   return (rsa.Decrypt(msg, false));
 }
 catch (CryptographicException e)
 {
   .....
 }
}
Anna - 25 Nov 2004 16:55 GMT
Hi Scott!

I have the same problem and the same error on win98.
I use the RSACryptoServiceProvider with the 1024 byte key.
Have you found already any solution?
Could you please help me?

best regards,
Anna
Scott - 26 Nov 2004 00:19 GMT
No solution yet.  I found an archived post from last year that was the
identical problem.  However, there were no solutions posted there either.  I
tried to email the guy, but no response.

Did you first encrypt on another platform, and are you decrypting on Win98?  
In my case I encrypted on WinXP and am attempting to decrypt on Win98.  The
archived post from last year indicated it would not be a problem if encrypted
and decrypted on Win98.  Have you tried this?  I haven't yet.  Makes me
wonder if its something about padding, but I have set OAEP padding to false
in all cases, as I believe it isn't supported on the older platforms.

I am in the Microsoft Partner program and would have expected Microsoft
Support to have responded to the post by now.  I will contact them to see if
they have missed my post  Keep watching and we might both get the answers we
need.

Scott.

> Hi Scott!
>
[quoted text clipped - 5 lines]
> best regards,
> Anna
Anna - 26 Nov 2004 09:14 GMT
Scott,
I will try  today to encrypt and decrypt both on the win98, however
I need also (winXP-->win98) and vice versa.
Could we communicate together via email?
It will be faster, I think.
Please write me at: ania_de2004[at]yahoo.com
I will let you know the results asap.

ps: I tryed to reach you under scott[at]msdn.com.au, but it doesn't work

regards,
Anna
Anna - 26 Nov 2004 09:53 GMT
Scott,
I will try  today to encrypt and decrypt both on the win98, however
I need also (winXP-->win98) and vice versa.
Could we communicate together via email?
It will be faster, I think.
Please write me at: ania_de2004[at]yahoo.com
I will let you know the results asap.

ps: I tryed to reach you under scott[at]msdn.com.au, but it doesn't work

regards,
Anna

> No solution yet.  I found an archived post from last year that was the
> identical problem.  However, there were no solutions posted there either.  I
[quoted text clipped - 23 lines]
> > best regards,
> > Anna

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.