I have a C# app which calls anumber of java applications some of which use SSH for various things. At the moment i get many pop up boxes from the java command line apps asking for passwords. I wonder if you have any concrete suggestions for how i could enter the password in C# then securely pass it to the java apps. At the moment i call the java apps using shell exec with many command line parameters.
The only thing i can think of is to somehow encrypt the password in c# and then decrypt it in java. but i suspect that they dont share a common decrypt process or if they did i’d have to pass the keys between the programs also …
any suggestions?
David
I think that encryption is a good solution.
But I can suggest you something else. You can write passwod in clear text to the stdin of java application from C# application. Java application should read the password from STDIN and use it. It is secure enough because unless reverse engineering or connecting to JVM using remote debugging API I do not know ways to intercept this stream. If both C# and java apps run on the same machine you cannot sniff the stream too.