The following Java code executes a command prompt with OpenSSL started and respective arguments.
When I type in the exact code in the command prompt it works and creates the output file in my home directory. However, through my java app it just launches the cmd quickly and shuts down without creating the output file in my home directory.
Runtime rt = Runtime.getRuntime();
try {
rt.exec(new String[]{"cmd.exe","/c","start openssl enc -aes-256-cbc -nosalt " +
"-in temp2.txt -out temp2.txt.enc -p -pass pass:QAAyADgAOAA9AEYAMAA6AEgANwBDAEIA"});
} catch (IOException e) {
e.printStackTrace();
}
Any ideas? Thanks in advance!