I have now come up with a solution to do this using PowerShell.
The steps I took are as follows:
- Cloned the Cipher Tools github project and created a new version of CipherTools that allows parameters to be passed in, to remove the need for interacting and deleted the Console.readline() which caused me issues.
- Created a new version of ciphertool.bat to make use of my new version of ciphertool.jar
- Updated my PowerShell script to call my new version of ciphertool.bat capturing the response
- Used the encrypted value I captured and stored it in WSO2 EI via the PropertiesAdminService
Format for calling the new ciphertool.bat:
ciphertool2.bat StorePassword ValueToEncrypt
An example of the call to the new ciphertool.bat in PowerShell:
$result = .\ciphertool2.bat wso2carbon test