Encrypt and Decrypt Database Passwords
The EnterpriseWizardConfig.xml
file contains database passwords stored in an encrypted format. In some scenarios, such as creating a read-only MySQL user, you must decrypt the database password. This requires you to encrypt the new root password and then replace the XML tag databaseAdminPassword
in EnterpriseWizardconfig.xml.
If you need to determine the original password, you can also decrypt the password from EnterpriseWizardconfig.XML
.
Note: The commands are platform independent, apart from the direction of the slashes.
- To encrypt a new password in the console, run the following command, replacing $ALHOME with the actual installation directory and newrootpassword with the actual password:
$ALHOME/jre/bin/java -jar $ALHOME/resources/java/lib/encrdecr.jar -e newrootpassword
. - To add the encrypted password, edit E
ntepriseWizardconfig.xml
and replace the XML tagdatabaseAdminPassword
with the new value:<databaseAdminPassword>-af6493d3a1c236cc3b5248210e0204e</databaseAdminPassword>
. - To decrypt the password in the console, enter the following command, replacing the given value with the one inside the
databaseAdminPassword
tag:$ALHOME/jre/bin/java -jar $ALHOME/resources/java/lib/encrdecr.jar -d 5dcd1311d8854747207a6df87216de44
The following bash string also performs the action:
$(grep -E '\<ewHome>.?\<' /etc/EnterpriseWizardConfig.xml | sed -r 's/\s*<\/?ewHome>//g')/jre/bin/java -jar $(grep -E '\<ewHome>.?\<' /etc/EnterpriseWizardConfig.xml | sed -r 's/\s*<\/?ewHome>//g')/resources/java/lib/encrdecr.jar -d $(grep -E '\<databaseAdminPassword>.?\<' /etc/EnterpriseWizardConfig.xml | sed -r 's/\s*<\/?databaseAdminPassword>//g')