How to Encrypt a file that is placed in midserver?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 06:40 AM
HI All,
I have a file at midsever. I want to encrypt that file in the midsever using code. I am using below code in my scrpt but its not working.
var midServer = "MIDserver";
var command = "gpg --encrypt --recipient 'EMAIL' "+ fileName ;
var probe = SncProbe.get("Command");
probe.setName(command);
var eccSysId = probe.create(midServer);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 07:03 AM
Hi Chanchal,
The value of any MID Server parameter in the config.xml file can be encrypted. The attributes for all encrypted values are managed from within the configuration file, including the security attribute of the login password.
![]() |
Procedure
- Navigate to the agent directory that was created when the MID Server was installed and open the config.xml file using a text editor such as WordPad.
- Locate or add the parameter you want to encrypt.
For example, you might want to protect your proxy server passwords by configuring this parameter:
<parameter name="mid.proxy.password" value="securepassw0rd"/>
- Add the encryption attribute secure="true".
<parameter name="mid.proxy.password" secure="true" value="securepassw0rd"/>
- Restart the MID Server.
- Open the config.xml file.
The encrypted password appears as follows:
.<parameter name="mid.proxy.password" secure="true" value="encrypted:rhrfUNYRzZAI8/BkTtZmNA=="/>
- To decrypt this or any other value in the config.xml file and display the value in clear text:
- Stop the MID Server.
- Set the secure="true" attribute to false.
- Replace the encrypted value with the clear text value.
- Restart the MID Server.
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 08:31 PM
Hey sandeep,
I have to define this parameters via script. I dont have direct access to this config file. Also the file i want to encrypt is a csv file.