PBE Cryptography

Discover more about the PBE Cryptography component and how to use it on the Digibee Integration Platform.

PBE Cryptography makes encryption and decryption operations using PBE algorithm (Password Based Encryption).

Parameters

Take a look at the configuration parameters of the component. Parameters supported by Double Braces expressions are marked with (DB).

ParameterDescriptionDefault valueData type

Crypto Operation

Available operation types - Encrypt Fields, Decrypt Fields, Encrypt Payload, and Decrypt Payload.

Encrypt Fields

String

Account

Account to be used by the component. A Secret key-type account is expected.

N/A

String

Iteration Count

Number of iterations with Salt.

1000

Integer

Algorithm

Algorithm type to be used.

PBEWithMD5AndDES

String

Fields To Encrypt/Decrypt

Fields to be encrypted/decrypted using a dotted notation (e.g., body.field1, body.field2, body).

a.test

String

Payload To Encrypt/Decrypt (DB)

Payload to be encrypted/decrypted using dotted notation. Double braces expressions are allowed.

N/A

String

Charset

Encoding type.

UTF-8

String

Secret Key Type

Secret key format (String, Hexadecimal, or Base64).

Base64

String

Fail On Error

If the option is activated, the pipeline with error execution will be suspended; otherwise, the pipeline execution continues, but the result will show a false value for the success property.

False

Boolean

Advanced Settings

Advanced configurations.

False

Boolean

Use Key From Payload

If activated, the option will use the payload secret key.

False

Boolean

Secret Key

Key in Hex or Base64 format.

N/A

String

Use Salt From Payload

If activated, the option will use the payload Salt; otherwise, a new Salt will be generated.

False

Boolean

Salt

Random data string used to change a password hash.

N/A

String

Encryption Key As Hex Value

If the option is activated, the secret key response will be in hexadecimal; otherwise, it will be in Base64 if the "Use Key From Payload" option is also activated.

False

Boolean

Salt As Hex Value

If the option is activated, the secret key response will be in hexadecimal; otherwise, it will be in Base64.

False

Boolean

Encrypted Message As Hex

If the option is activated, the secret key response will be in hexadecimal; otherwise, it will be in Base64.

False

Boolean

Messages flow

Encrypt via fields

Input

{  
    "accountLabel": "account",  
    "params": {    
        "operation": "encrypt_fields",    
        "iterationCount": 1000,    
        "keyType": "STRING",    
        "algorithm": "PBEWithMD5AndDES",    
        "encryptedFields": "a.test",    
        "failOnError": true  
    }
}

Payload

{  
    "a": {    
        "test": "test"  
    }
}

Output

{  
    "a": {    
        "test": "ZmRmcw=="  
    },  
    "_salt": "ZmRmcwZmRmcw=="
}

Decrypt via fields

Input

{  
    "accountLabel": "account",  
    "params": {    
        "operation": "decrypt_fields",    
        "iterationCount": 1000,    
        "keyType": "STRING",    
        "algorithm": "PBEWithMD5AndDES",    
        "encryptedFields": "a.test",    
        "useSaltFromPayload": true,    
        "salt": "{{ message._salt }}",    
        "failOnError": true  
    }
}

Payload

{  
    "a": {    
        "test": "ZmRmcw=="  
    },  
    "_salt": "ZmRmcwZmRmcw=="
}

Output

{  
    "a": {    
        "test": "test"  
    },  
    "_salt": "ZmRmcwZmRmcw=="
}

Encrypt via payload

Input

{
    "accountLabel": "pbe",    
        "params": {        
            "operation": "encrypt_payload",        
            "iterationCount": 1000,        
            "payload": "{{ message.a.test }}",        
            "keyType": "STRING",        
            "algorithm": "PBEWithMD5AndDES",        
            "failOnError": true    
        }
    }

Payload

{  
    "a": {    
        "test": "test"  
    }
}

Output

{  
    "a": {    
        "test": "test"  
    },  
    "result": "ZmRmcw==",  
    "_salt": "ZmRmcwZmRmcw=="
}

Decrypt via payload

Input

{
    "accountLabel": "pbe",    
    "params": {        
            "operation": "decrypt_payload",        
            "iterationCount": 1000,        
            "payload": "{{ message.a.test }}",        
            "keyType": "STRING",        
            "algorithm": "PBEWithMD5AndDES",        
            "useSaltFromPayload": true,
            "salt": "{{ message._salt }}",        
            "failOnError": true    
     }
}

Payload

{  
    "a": {    
        "test": "ZmRmcw=="  
    }
}

Output

{  
    "a": {    
        "test": "ZmRmcw=="  
    },  
    "result": "test",  
    "_salt": "ZmRmcwZmRmcw=="
}

Last updated