473,408 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Console application in page

I have developed a console application taking into paramters and
outputing an encrypted string.

I am trying to use this program in my php page by using the exec
command. I get the following error:

Unhandled Exception:
System.Security.Cryptography.CryptographicExceptio n: CryptoAPI
cryptographic service provider (CSP) for this implementation could not
be acquired. at
System.Security.Cryptography.RSACryptoServiceProvi der..ctor(Int32
dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) at
System.Security.Cryptography.RSACryptoServiceProvi der..ctor() at
Encryption.RSACSPSample.Encrypt(String toEncrypt, String publicKey) at
Encryption.RSACSPSample.Main(String[] args) Content-type: text/html
X-Powered-By: PHP/4.3.4

The odd thing is that once I log into my server and run the page, it
works. Once I log out out of my server and run this page I get the
above error.

The permissions on the exe are set to read/execute for Everyone and
IUSER. I even tried putting the exe in the system32 folder and also
gave full rights.

I have posted this in the PHP groups but I haven't been able to find a
solution.

Any ideas?

Thanks in advance,
Shahid

Oct 17 '05 #1
2 1288
The problem stems from user profile. I say this only because of your
symptoms. Reason is CSP implementations must create Key container in order
to store RSA assymetric keys. These containers are be stored in User
Profile. In ASP.NET page, as in some other instances, user profile is not
loaded. If my memory is correct, I think this is for performance reasons.
In any case, when no user profile is present, the key container can not be
created. However once you are to log in, then the container can be created
because a profile can be loaded and that's why problem no longer shows
itself.

To fix you need to tell Provider , RSA orDSA to use Machine key store. The
solution for which is too long to write out here, but in MSDN site, look up
article 322371 and it has code for full resolution and better explanation.
"Shahid" <sh*********@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
I have developed a console application taking into paramters and
outputing an encrypted string.

I am trying to use this program in my php page by using the exec
command. I get the following error:

Unhandled Exception:
System.Security.Cryptography.CryptographicExceptio n: CryptoAPI
cryptographic service provider (CSP) for this implementation could not
be acquired. at
System.Security.Cryptography.RSACryptoServiceProvi der..ctor(Int32
dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) at
System.Security.Cryptography.RSACryptoServiceProvi der..ctor() at
Encryption.RSACSPSample.Encrypt(String toEncrypt, String publicKey) at
Encryption.RSACSPSample.Main(String[] args) Content-type: text/html
X-Powered-By: PHP/4.3.4

The odd thing is that once I log into my server and run the page, it
works. Once I log out out of my server and run this page I get the
above error.

The permissions on the exe are set to read/execute for Everyone and
IUSER. I even tried putting the exe in the system32 folder and also
gave full rights.

I have posted this in the PHP groups but I haven't been able to find a
solution.

Any ideas?

Thanks in advance,
Shahid

Oct 18 '05 #2
Thank you very much. This helped a lot

Shahid

Oct 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
2
by: Martín Marconcini | last post by:
Hello there, I'm writting (or trying to) a Console Application in C#. I has to be console. I remember back in the old days of Cobol (Unisys), Clipper and even Basic, I used to use a program...
1
by: Ollie | last post by:
I have an aspx page that contains a web control that contains 2 text boxes and button to submit the text. I am trying to submit text and collect the response from a console application, but it is...
1
by: jam | last post by:
Dear all, I ask some question before and i got some idea, like background thread.... However, I still dun know how could i start implementing this, could someone help me on this and give me some...
6
by: Flip | last post by:
In j2ee/JBuilder/WebLogic when you do a System.err.println(), you can see the messages in the console that started the server. When I tried the same type of thing with VS 2k3 .NET and ASPX, I...
1
by: Weston Weems | last post by:
first the problem: I'd like to be able to clear particular cache items from a consol application running on the same server as the asp.net website. My problem is that if I reference System.Web...
9
by: John Williams | last post by:
How do I load a HTML page (via URL) and parse the DOM in a Console Application? I've successfully done all this in a Windows Application by using the WebBrowser control, calling the Navigate...
0
by: andy | last post by:
Hi, I'm trying to call an SAP Rfc from my .net application using the .Net SAP connector. I have to create a console application and through that I have to call the SAP RFC. I have been able to...
9
by: Mike | last post by:
Hi, I have the following problem: I have a singleton class that I want to access from asp.net application. The trick is, that I want to create it (Singleton.GetInstance() for the first time) in...
3
by: TheOne | last post by:
I'm newbie. I tried to compile and excute this super simple code. == codestart == class Sample1 { static void Main() { string person; person = "ÀÌÈ¿¸®¾¾"; System.Console.WriteLine(person +...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.