Using SafeQuard in Browser --------------------------- This section explains how to use the `SafeQuard_enc()` function to encrypt user-provided data. More details on the SafeQuard functions can be found in the :ref:`SafeQuard API Reference` and :ref:`SafeQuard Sequence Diagram`. Step 1: Include the SafeQuard Module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ First, add the `SafeQuard.js` file to your webpage by including it in a ` Step 2: Implement Encryption Logic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In your JavaScript code, you can define an asynchronous function, `SafeQuard_enc()`, to handle encryption. This function accepts input from an HTML element (such as a text input), encrypts the plaintext using the SafeQuard module, and then outputs the encrypted result to a JavaScript object. The following snippet provides a simple reference on using the encryption function. .. code-block:: html Example Use Case ~~~~~~~~~~~~~~~~~ .. code-block:: html

SafeQuard Encryption Example

Notes ~~~~~~ - The encryption function, `pQCee_SafeQuard_enc`, currently uses a fixed key ("key") in this example. This should be replaced with a secure key management approach for real-world applications. - Ensure that the SafeQuard module (`SafeQuard.js`) is loaded before attempting to use the `Module.ccall` function.