Jump to content

Share a derived cryp key between two instances of the same exe?


Recommended Posts

I am looking for a secure method of providing a single derived key to two copies of the same program. When you launch the program, the act of launching with no commandline params causes it to launch another exe with different purposes. If I generate the derived key on the first exe, is there a way I can securely pass this key on to the newly spawned process? I thought about including the password but that remains on the commandline of the running program that any good third-party task manager can see. So I need both processes to be able to encrypt and decrypt using the same key, without having to enter the password separately for each process.

Can you think of any way of achieving this?

Link to comment
Share on other sites

I already am using inter-process communication. I could communicate the password if I wanted too but that is not secure because the password could be easily intercepted. I need a secure method to pass an encryption derived key from one copy of the running exe to a secondary copy of the same exe. Otherwise I would have to do without certain data being encrypted by the first and decrypted by the second program.

Link to comment
Share on other sites

Same machine yes. One has admin rights, the other has normal rights. I need to send an exe and parameter to the non-admin process so that it runs it. However right now the ini for that is plain text. It is not a big deal because if something malicious is running on your computer that can interact with a simple file, it would be capable of running things its self. But I would like to protect the data so that the only things it will execute come from the parent process that spawned it via encryption and decryption.

Link to comment
Share on other sites

IPC doesn't need a file to communicate, you could use something like WM_COPYDATA to send/receive information from another script, or use Trancexx's mailslot function.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I see nothing useful in the helpfile about WM_COPYDATA. Seems like it is some kind of message code what ever that is. Do you have any context or example of however WM_COPYDATA would be useful to send or receive information back and forth?

Link to comment
Share on other sites

This uses a function that sends data to the SciTE window, but should be adaptable to other programs. 

'?do=embed' frameborder='0' data-embedContent>>

This is another example of doing something similar.

'?do=embed' frameborder='0' data-embedContent>>

This Trancexx's mailslot function that does the same thing as well.

 

As long as the receiving program understands what you're sending it should work. Or

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...