Share this page

# lr.encrypt_ex

Encrypts a string.

## C#

    string lr.encrypt_ex( String plaintext);

## Arguments

Name | Comments
--- | ---
plaintext | The string to encrypt.

The lr.encrypt_ex function is used to encrypt messages. Encryption is based on the AES-256-GCM algorithm and is compliant with FIPS requirements. The encrypted string can be decrypted by lr.decrypt_ex.

The AES key must be set before this function can be used. For details, see Add an AES key in the Help Center.

Tip: You can encrypt a string in the script using the same encryption method, by right-clicking the string and selecting Encrypt String (Stronger Encryption). The string is encrypted and inserted as an argument of lr.decrypt_ex.

## Return Values

This function returns an encrypted string.

## Parameterization

The argument plaintext can be parameterized.

## Example

Copy code

    namespace Script
    {
        public partial class VuserClass
        {
            public int Action()
            {
                string a = "Hello, World";
                var encryptedstring = lr.encrypt_ex(a);
                var result = lr.decrypt_ex(encryptedstring);
                lr.output_message(result);
                return 0;
            }
        }
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: