Skip to main content

Encrypt a string (string.aes128_encrypt)

Deprecated: This function is kept only for compatibility with existing scripts. For new scripts, use lua-openssl and choose an algorithm such as aes-128-ecb or aes-128-gcm.

Declaration​

encrypted = string.aes128_encrypt(data, key)

Parameters​

  • data
    string. The original string (or binary data) to encrypt.
  • key
    string. The password.

Returns​

  • encrypted
    string. Encrypted binary data.

Description​

Encrypt a string (or binary data) using AES128 algorithm in ECB mode.
Note: AES128 ECB mode has no iv (initialization vector). If an integration requires an iv field, use 0.

Example​

At the end of this chapter