User Guide > Managing Macro Sets and Macros > Re-encrypting Macros > Re-encrypting Macros Using New Scheme and Key
Was this helpful?
Re-encrypting Macros Using New Scheme and Key
Use the MacroReencoder tool to write a new macro definition file where the encrypted macros have been re-encrypted using a new user specified encryption scheme and encryption key. You can specify DES or DESede as the macro encryption scheme. The default scheme is DES.
The MacroReencoder tool is invoked using the MacroReencoder command. Before invoking the MacroReencoder tool, make sure that you have set the environment variables.
Prerequisite: The path of the cosmos.ini and MacroReencoder file must be set.
Set the path on Windows. The following is a sample command:
set PATH=C:\Program Files\Actian\di-standalone-engine-<DataConnect_version>\runtime\di9;%path%
set DJLIB=C:\ProgramData\Actian\DataConnect\actian-dc-studio-<DataConnect_version>
Set the path on AIX and Linux, The following is a sample command:
export DJLIB=/opt/Actian/di-standalone-engine-<DataConnect_version>/runtime/di9
export PATH=/usr/bin:/usr/sbin:/sbin:/usr/vacpp/bin:/opt/Actian/di-standalone-engine-<DataConnnect_version>/runtime/di9
Note:  The path mentioned above is the default path and a different location may be specified at install time.
MacroReencoder Command Line Options
 
Short Name
Full Name
Description
-h
--help
Displays the help message.
-i
--input
Specifies the input file.
-o
--output
Specifies the output file.
Note:  The output file should not be the same as the input file.
-r
--intput-scheme
Specifies the scheme of input file.
Note:  If you do not specify the scheme of the input file, it is read from the cosmos.ini file. If this property is missing from the cosmos.ini file, then it is assumed to be the default.
-j
--input-key
Specifies the key of input file.
Note:  If you do not specify the key of the input file, it is read from the cosmos.ini file. If this property is missing from the cosmos.ini file, then it is assumed to be the default.
-s
--output-scheme
Specifies the scheme of output file.
-k
--output-key
Specifies the key of output file.
MacroReencoder Command Syntax Examples
The following is an example that shows how to change from the current scheme and key to a user specified scheme and key.
To re-create the macro definition file:
1. Run the MacroReencoder command.
MacroReencoder.exe -s "DES" -k "It's very cold, a lot of snow. heavy" -i "D:\MacroDef.json" -o "D:\MacroDef_New.json"
If the scheme and key of the input file are not specified on the command line, they are read from the cosmos.ini file. If these properties are missing from the cosmos.ini file, then they are assumed to be the default.The MacroDef.json file will be read using the current scheme and key and then a new MacroDef_New.json file will be created. The encrypted macros within the new file will be re-encrypted using the new scheme and key that is specified using the -s and -k command line options. The new file will take the name that is specified using the -o option.
2. Set the following parameters in the cosmos.ini file.
MacroEncryptionScheme=DES
MacroEncryptionKey="It's very cold, a lot of snow. heavy"
3. Set the new macro definition file (MacroDef_New.json) using the macro preferences dialog.
4. Restart Actian DataConnect to use the new encryption settings when reading the new macro definition file (MacroDef_New.json).
 
The following is an example that shows how to change from one user specified scheme and key to another user specified scheme and key.
To re-create the macro definition file:
1. Run the MacroReencoder command.
MacroReencoder.exe -r "DES" -j "It's very cold, a lot of snow. heavy" -s "DESede" -k "Christmas is coming, Happy holiday!" -i "D:\MacroDef_Key1.json" -o "D:\MacroDef_Key2.json"
The MacroDef_Key1.json file will be read using the scheme and key that is specified using the -r and -j command line options and then a new MacroDef_Key2.json file will be created. The encrypted macros within the new file will be re-encrypted using the new scheme and key that is specified using the -s and -k command line options. The current file is specified using the -i option and the new file will take the name that is specified using the -o option.
2. Set the following parameters in the cosmos.ini file.
MacroEncryptionScheme=DESede
MacroEncryptionKey="Christmas is coming, Happy holiday!"
3. Set the new macro definition file (MacroDef_Key2.json) using the macro preferences dialog.
4. Restart Actian DataConnect to use the new encryption settings when reading the new macro definition file (MacroDef_Key2.json).
IMPORTANT!  The output file should not be the same as the input file.
 
Last modified date: 10/22/2024