Encryption/Decryption

You can use the encryption/decryption function to encrypt or decrypt specific elements in your messages. You can only decrypt the encrypted values (and vice versa) using the specified password, which must be set on this page. The supported key size is currently fixed to 128-bits only. 192 and 256-bit encryptions are not supported.
Note: You can only decrypt the encrypted values using a specific password. If the password is lost or changed, then the old messages are not decrypted.

This table shows the Encryption/Decryption parameters that you must follow to use the utility:

Aspect To Encrypt To Encrypt To Decrypt To Decrypt To check if a string is encrypted
Usage syntax CryptographUtility.encrypt(plainText) CryptographUtility.encrypt(plainText, varPwdIterations) CryptographUtility.decrypt(encryptedText) CryptographUtility.decrypt(encryptedText, varPwdIterations) CryptographUtility.isEncrypted(encryptedText)
Parameter plainText - Is any string/element selected to be encrypted.
  • plainText - Is any string/element selected to be encrypted.
  • The number of iterations to be used when deriving the key.
encryptedText
  • encryptedText - Is any string/element selected to be decrypted.
  • The number of iterations to be used when deriving the key.
encryptedText - Any string that is to be checked, if it is encrypted or not.
Return value encryptedText encryptedText decryptedText (or String) decryptedText (or String) true - If encrypted; otherwise, false.

This table shows the different error messages that you can encounter depending on the issues encountered by the utility:

Error Message Description
Please check the input element. This error shows during decryption, when the utility is unable to understand or decode the encrypted text.
Unexpected input element format. This error shows when the element to be decrypted is not in the expected format.
Encoding is not supported. This error shows if the element contains an unsupported character which the utility is unable to handle.
This element might have been encrypted with a different key. Unable to decrypt. This error shows when the key used to encrypt is not the same as the key used to decrypt.
Password Error. This error shows when there is a problem with trying to retrieve the password.
Password is missing or empty. This error shows when the password has not been defined in IEC.
An error occurred while encrypting/decrypting. This error shows when a general, but technical or internal problem during the encryption or decryption process occurs.
Key generation error. This error shows when a technical internal problem occurs during key generation.
Initialization error. This error shows when a technical internal problem occurs during initialization.
IV length is incorrect. This error shows when the used Salt or IV does not meet the specifications.

You can use the encryption/decryption function by following these steps:

  1. Select Settings > Encryption/Decryption.
  2. Specify the encryption/decryption key in the Set Encryption/Decryption Password field. Do not lose this information as you cannot decrypt messages encrypted using this key.
  3. Click Save.