WSO2 Carbon-based products uses asymmetric encryption by default as explained in the previous section. From Carbon 4.4.3 onwards, you have the option of switching to symmetric encryption in your WSO2 product. Using symmetric encryption means that a single key will be shared for encryption and decryption of information.
Follow the steps given below to enable symmetric encryption.
- Open the
carbon.xmlfile from the
Add the following properties:
IsEnabledproperty is used to set symmetric encryption to '
true' or '
Algorithmproperty specifies the symmetric key algorithm used.
SecureVaultAliasproperty is used to specify the secret alias if secure vault has been used to encrypt the secret key.
Create a file named '
symmetric-key.properties' in the
<PRODUCT_HOME>/repository/resources/securityfolder and enter the symmetric key using the
symmetric.keyproperty. See the following example where a plain text key is entered in the
If Secure Vault has been used for encrypting the symmetric key, this value will be replaced by the secret alias as shown below. For detailed instructions on how the secret key can be encrypted using Secure Vault, see Encrypting Passwords with Cipher Tool.