I hope this makes sense... I made a program which requires authorization by username and password, once logged in it will allow you to load a program. My question is, is there a tutorial for the program being called to only open if it has been called by a certain program (Only a certain program can open it).

I was looking up google for tutorials and fstream, but I cannot find anything. Could someone please push me in the right direction?

Thanks in advance,
Rave

Recommended Answers

All 4 Replies

Off the top of my head I would say it's not easily possible unless you set up the calling program to run as a unique user. Then you could check to see what user owns your program's process (such as with ps) and terminate if it isn't the right one.

You could also use a pseudorandom number calculated by the same means on both the client and server programs. You could pass this via an IPC mechanicsm. Not exactly 'secure', but would keep anybody from randomly executing.

dale

I have a idea that will work, once program A is open it will create a .bmp file with encrypted characters. The program B will search for this file and have the correct characters in it. If not it does not open.

However, I want to make it so when Program A is closed, the file is deleted (so program B wont run). How do I delete the bmp file after its been created?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.