Skip to main content
Version: 4.64

decrypt

Decrypts a value with the given algorithm and key and IV. The result will contain "data".

Field Configurations​

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters​

KeyTypeDescriptionDefault Value
"algorithm" (required)StringThe algorithm to use for this decryption.null
"async"BooleanSpecifies whether the action should perform asynchronously.null
"input" (required)StringThe input to encrypt.null
"inputEncoding" (required)StringThe encoding of the input and iv.null
"iv"StringThe IV for AES decryption.null
"key" (required)StringThe key to use for this decryption.null
"keyEncoding"StringThe encoding of the key.null
"onError"StringEvent that will be fired if the decryption was successfull.null
"onErrorType"OnErrorTypeType of event that will be fired on error.null
"onSuccess"StringEvent that will be fired if the decryption was successfull.null
"onSuccessType"OnSuccessTypeType of event that will be fired on success.null
"outputEncoding"StringThe encoding for the output.null
"useDefaultSalt"BooleanDetermines if the default key salt should be used for the key. If not, the key must be a valid AES key.null

Inherited​

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType name of the action.null

Examples​

Example 1: Decrypt text with a password​

Show ExampleHide Example

Goal: Decrypt text, like a JWT, with a password to use it.

Decrypt the given text using the password and iv. On success, the decrypted text is stored encoded in decryptedData.data.

{
"type": "decrypt",
"leadingDelimiter": "{$",
"trailingDelimiter": "$}",
"dynamicParams": {
"jwt": {
"context": "userSetting",
"field": "jwt"
},
"jwtIv": {
"context": "userSetting",
"field": "jwtIv"
},
"password": {
"context": "namedForm",
"field": "login:password"
}
},
"params": {
"algorithm": "AES",
"input": "{$jwt$}",
"key": "${password$}",
"iv": "${jwtIv}",
"inputEncoding": "base64",
"keyEncoding": "utf8",
"useDefaultSalt": true,
"outputEncoding": "utf8",
"onSuccessType": "return",
"onSuccess": "decryptedData"
}
}