1. Hashtag Helpers
  2. PKC Encrypt

Hashtag Helpers

PKC Encrypt

Asymmetrically encrypts data for secure service communication

This hashtag helper enables asymmetric encryption of sensitive data, ensuring that only intended services can decrypt the information. When used without arguments, any Stubber service can decrypt the data. When a service is specified, only that service will be able to decrypt the data. You can further restrict decryption by specifying an identifier that the service must be using.

NOTE

The encryption happens at substitution time. Make sure the data you want to encrypt is available in the service performing the encryption.

Uses

  • Secure sensitive data transmission between services
  • Restrict data access to specific services
  • Encrypt PINs, passwords, and other sensitive information
  • Ensure data can only be decrypted by intended services
  • Hide data from the Stubber System and Stubber UI completely
  • Restrict decryption to specific identifiers within a service

Usage

Helper name: pkc_encrypt

Arguments

Position Description
1 (Optional) Target service that can decrypt (e.g. 'whatsapp', 'apicall')
2 (Optional) Identifier within the service (e.g. phone number for WhatsApp, URL for API Call)

Parameters

Position Description
1 Value to be encrypted

eg. ~~#pkc_encrypt#value_to_encrypt or ~~#pkc_encrypt 'service_name'#value_to_encrypt or ~~#pkc_encrypt 'service_name' 'identifier'#value_to_encrypt

NOTE

The actual encrypted data will look something like this:

        ~~#target 'whatsapp'#~~#pkc_decrypt 'whatsapp' '~~__identifier'#Je6BAeYgT1myQvPAgofBhkHudDSrFpvPrGhBCs52khtPjZ602JEyP8rmtkHKsmTQR7sP+kQRZyb67EOitlEG7Yli+IEaUUc6S9aILcRK0VtuS5gMt8CpyS1IzUXCRx0MSCoId7kAiG7OvH8M3K/ysWWOup8QmP6jZwcS5BLXuaZQPBvsNesbKyEyW31gQuZRDjSKTl27wstAK2OKVLci/qUTE+4cxcjHmp7lJzIMW4DdwoAW6TNlNXM5JsxF8jyUiS5+AmmApRi0wpXDBY/Xe4vLMzlX53ht+gW7CpDpZkUXx59PTuY4Qt6AOoe0JX5sJDkg4oKZd+7eunUS5GJxVA==

      

The system automatically handles the decryption process when the data reaches the appropriate service with the correct identifier.

Examples

Basic Encryption

This example shows basic encryption where any service can decrypt the data.

Usage Example

loading...

Result

loading...

Service-Specific Encryption

Usage Example

loading...

Result

loading...

Identifier-Specific Encryption

This example shows how to encrypt data that can only be decrypted by a specific service when using a specific identifier.

Usage Example

loading...

Result

loading...

Combined with Target Helper

This example shows how to use PKC Encrypt with the Target helper to control where encryption happens.

Usage Example

loading...

In this example:

  • The encryption only happens in the API Call service (where apiresult is available)
  • Only the WhatsApp service can decrypt the final encrypted value
  • WhatsApp can only decrypt when sending to the phone number 27713334444
  • Other services will see the encrypted data but cannot decrypt it

Result (When processed by API Call service)

editor
        {
  "success": true,
  "payload": {
    "apiresult": {
      "body": {
        "brand": "encrypted_data_that_only_whatsapp_can_decrypt_when_using_identifier_27713334444"
      },
    }
  }
}

      

Result (When processed by other services)

loading...

API Call with URL-specific Encryption

This example shows how to encrypt data that can only be decrypted by the API Call service when making a request to a specific URL.

Usage Example

loading...

In this example:

  • The API key is encrypted so that only the API Call service can decrypt it
  • The API Call service can only decrypt it when making a request to the specific URL
  • This prevents the API key from being used with other endpoints
TIP

When encrypting data that's only available in a specific service (like API results), always use the Target helper to ensure the encryption happens in the correct service.

NOTE

For different services, the identifier has different meanings:

  • WhatsApp: The phone number (e.g., '27713334444')
  • API Call: The URL of the API endpoint
  • Other services may use different identifiers