If you start openssl.exe, that's the mode it's in by default - waiting for
commands from stdin, writing the output from those commands to stdout. Isn't
that what you're looking for?
If you're looking for advice on the programming details of attaching to its
stdin and stdout and sending/receiving that data from another program, you'd
probably be better asking on a general Windows programming list where there'll
be more people with that sort of expertise.
Regards,
jjf
From: Funnell, Leon [mailto:[email protected]]
Sent: Monday, October 22, 2012 10:52 AM
To: [email protected]
Subject: How can I pass data to a running instance of OpenSSL CLI on Windows
within a batch file?
We have Windows application which passes data to OpenSSL.exe to encrypt as a
Windows command, then scrapes the encrypted data back from the output. The
Windows app can call external Windows commands but we cannot call APIs or
extend the functionality programmatically. Functionally it works, but it
doesn't scale as each time you call OpenSSL.exe it takes about a second and
spikes the CPU. The application we are using is required to process 6000
records every hour.
I have two tests set up:
1. A batch file which runs 6000 times, repeatedly running the following
command:
Openssl.exe aes-256-cbc -a -e -k eiccmkjd94jfgniw03ljkdlfutcnv320 -in test.txt
2. A text file with the following line repeated 6000 times, which I paste
into the OpenSSL CLI:
aes-256-cbc -a -e -k eiccmkjd94jfgniw03ljkdlfutcnv320 -in test.txt
When I use the batch file which invokes OpenSSL.exe 6000 times, it takes
several hours to complete and spikes the CPU significantly. It seems to be the
initialisation of the OpenSSL.exe program rather than the encryption however,
as if I paste in the text file to the OpenSSL.exe CLI it completes in several
seconds and takes very little CPU.
What I need is a way of running OpenSSL.exe as a process which I can pass
parameters to on STDIN, and output parameters to STDOUT. I would like to be
able to call another batch file or program with the unencrypted data as the
input parameter which would then pass this to the running "service", retrieve
the encrypted data result from this "service" and pass it as the output.
Can anyone enlighten me on a potential solution for this?
Thanks and Regards,
Leon Funnell
________________________________________________________
This e-mail is confidential and intended solely for the use of the
individual(s) to whom it is addressed. If you are not the intended recipient,
be advised that you have received this e-mail in error and that any use,
dissemination, forwarding, printing, copying of, or any action taken in
reliance upon it, is strictly prohibited and may be illegal.
Catlin Underwriting Agencies Limited and Catlin Insurance Company (UK) Ltd. are
authorised and regulated by the Financial Services Authority.
The registered office of Catlin Underwriting Agencies Limited (incorporated and
registered in England and Wales with company number 1815126) and Catlin
Insurance Company (UK) Ltd. (incorporated and registered in England and Wales
with company number 5328622) is 20 Gracechurch Street, London, EC3V 0BG.
Catlin Risk Solutions Limited is an Appointed Representative of Catlin
Underwriting Agencies Limited.
________________________________________________________