.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Does .Net RSA Library support RSA Private Key Encryption using just D, modulus, and exponent?

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :.NET Framework

I am creating a routine to replace old legacy code, that needs to encrypt a chunk of data with an old key. I only have D, the Modulus, and the Exponent. With the old code, I could encrypt using these, but the key sizes are now not flexible enough for the modern use of the code. Key sizes are large - 1024bits, 1152bits, up to 1536bits. (New large keys of course can be created and used via CRT, but I need to maintain support for the existing keys already in use.)

Does the MS .Net RSACryptographicProvider class allow any way of encrypting data with the private key, *without* needing the whole private key parts - ie. P,Q, Inverse Q, etc.. The encryption method is known as ME. Encryption using CRT method is quicker, but requires all parts of the private key to be known.

When I try to use the .Net class, it always responds with an "Only the public parts of the key are known. To encrypt, you require the private key part." error. I have provided the parts that are known - D, modulus, and exponent.


Incidentally, does the .Net class support an exponent of 03?


Code snippet:

using namespace System::Security::Cryptography;

                    CspParameters^ cspParams = gcnew CspParameters;

View Complete Post

More Related Resource Links

does SPD support filtering of the mail title/body we send to a list/library?

for example, if we send a mail with the title of "%hostname% %ipaddress%" to a list. can SPD WF filter the title and get %hostname% to a new variable? the reason to ask this is i want to send a well-formated mail to sharepoint and the automatical WF can recognize the change of the list items and update the relevant columns by the filtered content from mail title or body. thanks!

How to add encryption key automatically in MS Enterprise Library

I'm a team member in developing an enterprise application that will be generating packages to submit to the enterprise contractors to install it at their PC. One of my tasks is to add encryption to the application's fields. this was accomplished by add encryption key to app.config file and the key was generated by MS Enterprise Library manager. In the above step I have to go to the manager application and create the key then copy it and paste it to the application config file. This is valid to be done in the current machine but once we created a setup project and generated a package and send it to the contractor, this step has to be done manually and at the contractor site. Is there a way to generate the key and add it to the application config file automatically on the application setup or at package generation? I hope that my case is clear and I need your help guys as I already tried to resolve this issue and the task due date is next week and I don't want to delay it. Thanks in advance for everyone who is going to help.

Public Private Key Based Encryption


Hello Guys

I need to encrypt some info using my Public/Private key, and allow the other party(users) to ONLY DECRYPT what I encrypted. I don't want them to be able to know how I encrypted my message. How it is possible in .NET using public and private key pair?

I tried RSACryptoServiceProvider in .NET but the issue with that is

i) We can only encrypt using Public key and decrypt using Private key
ii) Private key xml string always contains public key xml string.

So if i use RSA than i have to distribute Private key along with public key to the users who needs to decrypt my message.

Can you please help how to over come above situation where i do not have to sent with which key i encrypted.

Please help



RSA Encryption - Encrypt with private key

Hey everyone, 

I am looking for a way to encrypt data with a private key, and have the public key decrypt it. I am aware this is generally NOT what you want from encryption, as it will be readable with by anyone with the public key, but that is exactly what I require. 

I require a string of data to be encrypted by the private key, so that only I can create the encrypted data, and have my application read it by the public key. The idea behind this is to create a license file for my application, encrypt the license details, and have the application read this data. This will prevent licenses being generated by anyone other than me, however will allow the application to read it by the public key. 

The idea of this is to control the encrypted data, and not care who can read it, only who can create it. 

Using the RSACryptoServiceProvider, I can create my public/private keys, I can encrypt the data with the private key, however when I go to decrypt with the public key, I get a "Key Not Found" exception. 

Signing with RSA is also not possible, as I need to compare encrypted data with plain text data, to ensure the license is valid, and signing only verifies the source, not what it contains

Errors in the encryption library: Failed to encrypt sensitive data. Possibly the encryption key is i

Hi Experts,

While I was processing my CUBE, it prompts me this error:

Errors in the encryption library: Failed to encrypt sensitive data. Possibly the encryption key is inaccessible because of improper service account change.


it is deployed on SQL Server 2005 developer edition with SP2 which support Window Vista Ultimate.

Can anyone fix this?


ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

.NET 3.5 Adds Named Pipes Support

you want a named pipe server, all you have to do is create some instances of NamedPipeServerStream to handle each client connection. I stole the following code straight from the MSDN documentation.

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

A flexible charting library for .NET

ZedGraph is a class library, Windows Forms UserControl, and ASP web-accessible control for creating 2D line, bar, and pie graphs of arbitrary datasets. The classes provide a high degree of flexibility - almost every aspect of the graph can be user-modified. At the same time, usage of the classes is kept simple by providing default values for all of the graph attributes. The classes include code for choosing appropriate scale ranges and step sizes based on the range of data values being plotted. Moreover, ZedGraph is compatible with .NET 2.0, and VS .NET 2005.

Enterprize library 4.1 getting output parameter after adding record in db, plz guide



I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide


Basic Support


Can anyone help me please?


I have been producing a registration form using html and asp.  I have managed to get it to send an email having copied script from a previous website which someone developed for me.  I now get the response going to the old address and with then old text.  How can I change it all to the new site?

This has been very frustrating as I am sure someone is going to say all I have to do is ...




Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

PHP support for VS 2010


While I do most of our development in .net, we do have some systems in php. I was just wondering if there is any php support for VS 2010. I found vs.php 2.7, but frankly, VS is expensive enough, I don't want to have to buy something else for php support. I use eclipse right now which works fine, I just kind of wanted to consolidate my editors and only have one. Does anyone have any ideas for me? Thanks,

deploying to msdeploy does not support a proxy server


I am trying to deploy through webmatrix but my system Proxy server configuration is not being used. I assume that webmatrix would detect the proxy server settings and use that for the msdeploy calls under the hood. Can anyone confirm this is a know issue? 

View State Encryption


Hi All,

Why is it that I see the same hash value generated when I use different algorithms for viewstate encryption. I have added below lines to the web.config file

<pages viewstateEncryptionMode="Always"

MVC + Enterprise Library


Not a MVC specific question, but as that's what I'm doing I thought I'll post here.

While looking into the source code of an existing application, I stumbled upon MS Enterprise Library, and as I only heard about these "application block" stuff decided to look into it.

From the theory it sounds like a pretty usefull thing and it made me wonder if other's are using it succesfully along with MVC projects (I know they are not really related!)?

Pro's and Con's? 

I like the database block, as I did not get to any real database development the last 1.5 years, for instance. (Bad excuse I know).  Having an IoC thrown in there (Unity) sounds like I can pretty much stop using 3rd party libraries like I do now all over the place.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend