View Source GrowthBook.DecryptionUtils (GrowthBook v0.3.0)

Utilities for decrypting encrypted features from GrowthBook API. Uses AES-CBC with PKCS7 padding.

Link to this section Summary

Functions

Decrypts an encrypted payload using the provided decryption key.

Link to this section Functions

Link to this function

decrypt(payload, decryption_key)

View Source

Specs

decrypt(binary() | String.t(), binary() | String.t()) ::
  {:ok, binary()} | {:error, String.t()}

Decrypts an encrypted payload using the provided decryption key.

The payload should be in the format "iv.ciphertext" where both parts are base64 encoded. Returns {:ok, decrypted_string} on success or {:error, reason} on failure.